Documentation ¶
Index ¶
- type V
- func (v V[T]) Abs() V[T]
- func (v V[T]) Add(n V[T]) V[T]
- func (v V[T]) Angle() float64
- func (v V[T]) Ceil() V[T]
- func (v V[T]) Cross(n V[T]) T
- func (v V[T]) Div(n V[T]) V[T]
- func (v V[T]) DivScalar(n T) V[T]
- func (v V[T]) Dot(n V[T]) T
- func (v V[T]) Equal(n V[T]) bool
- func (v V[T]) Floor() V[T]
- func (v V[T]) IsZero() bool
- func (v V[T]) Len() T
- func (v V[T]) LenSquared() T
- func (v V[T]) Max(n V[T]) V[T]
- func (v V[T]) Min(n V[T]) V[T]
- func (v V[T]) Mul(n V[T]) V[T]
- func (v V[T]) MulScalar(n T) V[T]
- func (v V[T]) Neg() V[T]
- func (v V[T]) Norm() V[T]
- func (v V[T]) Perpendicular() V[T]
- func (v V[T]) Rotate(angle float64) V[T]
- func (v V[T]) String() string
- func (v V[T]) Sub(n V[T]) V[T]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type V ¶
type V[T numeric] struct {
X, Y T
}
V represents 2D vector.
func (V[T]) IsZero ¶ added in v1.2.0
IsZero return true if vector has both coordinates equal to zero.
func (V[T]) LenSquared ¶ added in v1.2.0
func (v V[T]) LenSquared() T
LenSquared same as Len(), but without sqrt.
func (V[T]) Perpendicular ¶ added in v1.1.0
Perpendicular returns the perpendicular/normal vector.
Click to show internal directories.
Click to hide internal directories.