Documentation
¶
Index ¶
- func Abs[T Numbers](v T) T
- func CountDigits[T Numbers](num T) int
- func Mod(a, b int) int
- func Pow[T Numbers](base T, power uint) T
- func Sign[T Numbers](v T) int
- type Numbers
- type Vector2
- func (v Vector2[T]) Add(av Vector2[T]) Vector2[T]
- func (v Vector2[T]) ManhattanDst(v2 Vector2[T]) T
- func (v Vector2[T]) Mul(scalar T) Vector2[T]
- func (v Vector2[T]) Norm() Vector2[T]
- func (v Vector2[T]) RotateLeft() Vector2[T]
- func (v Vector2[T]) RotateRight() Vector2[T]
- func (v Vector2[T]) String() string
- func (v Vector2[T]) Sub(av Vector2[T]) Vector2[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountDigits ¶
Types ¶
type Vector2 ¶
type Vector2[T Numbers] struct { X T Y T }
func NewVector2 ¶
func (Vector2[T]) ManhattanDst ¶
func (Vector2[T]) RotateLeft ¶
RotateLeft rotates the vector to the left (left-handed system)
func (Vector2[T]) RotateRight ¶
RotateRight rotates the vector to the right (left-handed system)
Click to show internal directories.
Click to hide internal directories.