Documentation
¶
Index ¶
- type Float32
- type Float64
- type Int
- type Int64
- type Vector
- func Average[T vector.Number](vectors []Vector[T]) Vector[T]
- func Lerp[T vector.Number](a, b Vector[T], t float64) Vector[T]
- func Max[T vector.Number](a, b Vector[T]) Vector[T]
- func Min[T vector.Number](a, b Vector[T]) Vector[T]
- func New[T vector.Number](x, y, z, w T) Vector[T]
- func One[T vector.Number]() Vector[T]
- func Zero[T vector.Number]() Vector[T]
- func (v Vector[T]) Add(other Vector[T]) Vector[T]
- func (v Vector[T]) DivByConstant(t float64) Vector[T]
- func (v Vector[T]) Dot(other Vector[T]) float64
- func (v Vector[T]) MarshalJSON() ([]byte, error)
- func (v Vector[T]) Scale(t float64) Vector[T]
- func (v Vector[T]) SetW(newW T) Vector[T]
- func (v Vector[T]) SetX(newX T) Vector[T]
- func (v Vector[T]) SetY(newY T) Vector[T]
- func (v Vector[T]) SetZ(newZ T) Vector[T]
- func (v Vector[T]) Sub(other Vector[T]) Vector[T]
- func (v Vector[T]) ToFloat32() Vector[float32]
- func (v Vector[T]) ToFloat64() Vector[float64]
- func (v Vector[T]) ToInt() Vector[int]
- func (v Vector[T]) ToInt64() Vector[int64]
- func (v *Vector[T]) UnmarshalJSON(data []byte) error
- func (v Vector[T]) W() T
- func (v Vector[T]) X() T
- func (v Vector[T]) Y() T
- func (v Vector[T]) Z() T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vector ¶
Vector contains 4 components
func Average ¶
Average sums all vector3's components together and divides each component by the number of vectors added
func (Vector[T]) Add ¶
Add takes each component of our vector and adds them to the vector passed in, returning a resulting vector
func (Vector[T]) DivByConstant ¶
func (Vector[T]) MarshalJSON ¶
func (*Vector[T]) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.