Documentation ¶
Index ¶
- func OffsetOf(shape, index Shape) int
- func SizeOf(shape Shape) int
- type Euler
- type EulerRotationOrder
- type Index
- type Indices
- type Matrix
- func (mat Matrix[T]) Add(other Matrix[T]) Matrix[T]
- func (mat Matrix[T]) At(index Shape) T
- func (mat Matrix[T]) Columns() int
- func (mat Matrix[T]) Determinant() T
- func (mat Matrix[T]) Div(other Matrix[T]) Matrix[T]
- func (mat Matrix[T]) Dot(other Matrix[T]) Matrix[T]
- func (mat Matrix[T]) DotVec(vec Vector[T]) Vector[T]
- func (mat Matrix[T]) Elements() []T
- func (mat Matrix[T]) Get(i, j int) T
- func (mat Matrix[T]) Invert() Matrix[T]
- func (mat Matrix[T]) Mul(other Matrix[T]) Matrix[T]
- func (mat Matrix[T]) Norm() T
- func (mat Matrix[T]) Normalize() Matrix[T]
- func (mat Matrix[T]) Normp(p T) T
- func (mat Matrix[T]) Rows() int
- func (mat Matrix[T]) Scale(x T) Matrix[T]
- func (mat *Matrix[T]) Set(i, j int, x T)
- func (mat Matrix[T]) Shape() Shape
- func (mat Matrix[T]) SquaredLength() T
- func (mat Matrix[T]) String() string
- func (mat Matrix[T]) Sub(other Matrix[T]) Matrix[T]
- func (mat Matrix[T]) Sum() T
- func (mat Matrix[T]) Transpose() Matrix[T]
- type Matrix2
- func (mat Matrix2[T]) Add(other Matrix2[T]) Matrix2[T]
- func (mat Matrix2[T]) At(index Shape) T
- func (mat Matrix2[T]) Determaint() T
- func (mat Matrix2[T]) Div(other Matrix2[T]) Matrix2[T]
- func (mat Matrix2[T]) Dot(other Matrix2[T]) Matrix2[T]
- func (mat Matrix2[T]) DotVec2(vec Vector2[T]) Vector2[T]
- func (mat Matrix2[T]) Get(i, j int) T
- func (mat Matrix2[T]) Invert() Matrix2[T]
- func (mat *Matrix2[T]) MakeIdentity() *Matrix2[T]
- func (mat *Matrix2[T]) MakeRotation(theta T) *Matrix2[T]
- func (mat *Matrix2[T]) MakeScale(vec Vector2[T]) *Matrix2[T]
- func (mat *Matrix2[T]) MakeZero() *Matrix2[T]
- func (mat Matrix2[T]) Mul(other Matrix2[T]) Matrix2[T]
- func (mat Matrix2[T]) Norm() T
- func (mat Matrix2[T]) Normalize() Matrix2[T]
- func (mat Matrix2[T]) Normp(p T) T
- func (mat Matrix2[T]) Scale(v T) Matrix2[T]
- func (mat *Matrix2[T]) Set(i, j int, x T)
- func (mat *Matrix2[T]) SetElements(n11, n12, n21, n22 T) *Matrix2[T]
- func (mat Matrix2[T]) Shape() Shape
- func (mat Matrix2[T]) SquaredLength() T
- func (mat Matrix2[T]) String() string
- func (mat Matrix2[T]) Sub(other Matrix2[T]) Matrix2[T]
- func (mat Matrix2[T]) Sum() T
- func (mat Matrix2[T]) Transpose() Matrix2[T]
- type Matrix3
- func (mat Matrix3[T]) Add(other Matrix3[T]) Matrix3[T]
- func (mat Matrix3[T]) At(index Shape) T
- func (mat Matrix3[T]) Determaint() T
- func (mat Matrix3[T]) Div(other Matrix3[T]) Matrix3[T]
- func (mat Matrix3[T]) Dot(other Matrix3[T]) Matrix3[T]
- func (mat Matrix3[T]) DotVec2(vec Vector2[T]) Vector3[T]
- func (mat Matrix3[T]) DotVec3(vec Vector3[T]) Vector3[T]
- func (mat Matrix3[T]) Elements() []T
- func (mat Matrix3[T]) Get(i, j int) T
- func (mat Matrix3[T]) Invert() Matrix3[T]
- func (mat *Matrix3[T]) MakeIdentity() *Matrix3[T]
- func (mat *Matrix3[T]) MakeRotationAxis(axis Vector3[T], angle T) *Matrix3[T]
- func (mat *Matrix3[T]) MakeRotationX(theta T) *Matrix3[T]
- func (mat *Matrix3[T]) MakeRotationY(theta T) *Matrix3[T]
- func (mat *Matrix3[T]) MakeRotationZ(theta T) *Matrix3[T]
- func (mat *Matrix3[T]) MakeScale(vec Vector3[T]) *Matrix3[T]
- func (mat *Matrix3[T]) MakeShear(xy, xz, yx, yz, zx, zy T) *Matrix3[T]
- func (mat *Matrix3[T]) MakeZero() *Matrix3[T]
- func (mat Matrix3[T]) Mul(other Matrix3[T]) Matrix3[T]
- func (mat Matrix3[T]) Norm() T
- func (mat Matrix3[T]) Normalize() Matrix3[T]
- func (mat Matrix3[T]) Normp(p T) T
- func (mat Matrix3[T]) Scale(v T) Matrix3[T]
- func (mat *Matrix3[T]) Set(i, j int, x T)
- func (mat *Matrix3[T]) SetElements(n11, n12, n13, n21, n22, n23, n31, n32, n33 T) *Matrix3[T]
- func (mat Matrix3[T]) Shape() Shape
- func (mat Matrix3[T]) SquaredLength() T
- func (mat Matrix3[T]) String() string
- func (mat Matrix3[T]) Sub(other Matrix3[T]) Matrix3[T]
- func (mat Matrix3[T]) Sum() T
- func (mat Matrix3[T]) Transpose() Matrix3[T]
- type Matrix4
- func (mat Matrix4[T]) Add(other Matrix4[T]) Matrix4[T]
- func (mat Matrix4[T]) At(index Shape) T
- func (mat *Matrix4[T]) Compose(position Vector3[T], quaternion Vector4[T], scale Vector3[T]) *Matrix4[T]
- func (mat Matrix4[T]) Decompose() (position Vector3[T], quaternion Vector4[T], scale Vector3[T])
- func (mat Matrix4[T]) Determinant() T
- func (mat Matrix4[T]) Div(other Matrix4[T]) Matrix4[T]
- func (mat Matrix4[T]) Dot(other Matrix4[T]) Matrix4[T]
- func (mat Matrix4[T]) DotVec2(vec Vector2[T]) Vector3[T]
- func (mat Matrix4[T]) DotVec3(vec Vector3[T]) Vector3[T]
- func (mat Matrix4[T]) DotVec4(vec Vector4[T]) Vector4[T]
- func (mat Matrix4[T]) Elements() []T
- func (mat Matrix4[T]) Get(i, j int) T
- func (mat Matrix4[T]) GetPosition() Vector3[T]
- func (mat Matrix4[T]) GetQuaternion() Vector4[T]
- func (mat Matrix4[T]) Invert() Matrix4[T]
- func (mat *Matrix4[T]) MakeFromMatrix3(m Matrix3[T]) *Matrix4[T]
- func (mat *Matrix4[T]) MakeIdentity() *Matrix4[T]
- func (mat *Matrix4[T]) MakeOrthographic(left, right, top, bottom, near, far T) *Matrix4[T]
- func (mat *Matrix4[T]) MakePerspective(left, right, top, bottom, near, far T) *Matrix4[T]
- func (mat *Matrix4[T]) MakeRotationAxis(axis Vector3[T], angle T) *Matrix4[T]
- func (mat *Matrix4[T]) MakeRotationX(theta T) *Matrix4[T]
- func (mat *Matrix4[T]) MakeRotationY(theta T) *Matrix4[T]
- func (mat *Matrix4[T]) MakeRotationZ(theta T) *Matrix4[T]
- func (mat *Matrix4[T]) MakeScale(vec Vector3[T]) *Matrix4[T]
- func (mat *Matrix4[T]) MakeShear(xy, xz, yx, yz, zx, zy T) *Matrix4[T]
- func (mat *Matrix4[T]) MakeTranslation(vec Vector3[T]) *Matrix4[T]
- func (mat *Matrix4[T]) MakeZero() *Matrix4[T]
- func (mat Matrix4[T]) Mul(other Matrix4[T]) Matrix4[T]
- func (mat Matrix4[T]) Norm() T
- func (mat Matrix4[T]) Normalize() Matrix4[T]
- func (mat Matrix4[T]) Normp(p T) T
- func (mat Matrix4[T]) Scale(v T) Matrix4[T]
- func (mat *Matrix4[T]) Set(i, j int, x T)
- func (mat *Matrix4[T]) SetElements(...) *Matrix4[T]
- func (mat *Matrix4[T]) SetPosition(pos Vector3[T]) *Matrix4[T]
- func (mat Matrix4[T]) Shape() Shape
- func (mat Matrix4[T]) SquaredLength() T
- func (mat Matrix4[T]) String() string
- func (mat Matrix4[T]) Sub(other Matrix4[T]) Matrix4[T]
- func (mat Matrix4[T]) Sum() T
- func (mat Matrix4[T]) Transpose() Matrix4[T]
- type Shape
- type Tensor
- func Create[T constraints.SignedReal](shape Shape) Tensor[T]
- func Dot[T constraints.SignedReal](a, b Tensor[T]) Tensor[T]
- func Product[T constraints.SignedReal](a, b Tensor[T]) Tensor[T]
- func Reshape[T constraints.SignedReal](tensor Tensor[T], shape Shape) Tensor[T]
- func Scalar[T constraints.SignedReal](x T) Tensor[T]
- type Vector
- func Linspace[T constraints.SignedReal](from, to T, n int) Vector[T]
- func Range[T constraints.SignedReal](start, end T) Vector[T]
- func RangeN[T constraints.SignedReal](n T) Vector[T]
- func Repeat[T constraints.SignedReal](x T, n int) Vector[T]
- func Vec[T constraints.SignedReal](elements ...T) Vector[T]
- func (vec Vector[T]) Add(other Vector[T]) Vector[T]
- func (vec Vector[T]) At(index Shape) T
- func (vec Vector[T]) Dim() int
- func (vec Vector[T]) Div(other Vector[T]) Vector[T]
- func (vec Vector[T]) Dot(other Vector[T]) T
- func (vec Vector[T]) Elements() []T
- func (vec Vector[T]) Get(i int) T
- func (vec Vector[T]) Mul(other Vector[T]) Vector[T]
- func (vec Vector[T]) Norm() T
- func (vec Vector[T]) Normp(p T) T
- func (vec Vector[T]) Set(i int, v T)
- func (vec Vector[T]) Shape() Shape
- func (vec Vector[T]) SquaredLength() T
- func (vec Vector[T]) String() string
- func (vec Vector[T]) Sub(other Vector[T]) Vector[T]
- func (vec Vector[T]) Sum() T
- type Vector2
- func (vec Vector2[T]) Add(other Vector2[T]) Vector2[T]
- func (vec Vector2[T]) At(index Shape) T
- func (vec *Vector2[T]) Copy(other Vector2[T])
- func (vec Vector2[T]) Cross(other Vector2[T]) T
- func (vec Vector2[T]) Div(other Vector2[T]) Vector2[T]
- func (vec Vector2[T]) Dot(other Vector2[T]) T
- func (vec Vector2[T]) Get(i int) T
- func (vec Vector2[T]) Mul(other Vector2[T]) Vector2[T]
- func (vec Vector2[T]) Norm() T
- func (vec Vector2[T]) Normalize() Vector2[T]
- func (vec Vector2[T]) Normp(p T) T
- func (vec Vector2[T]) Scale(k T) Vector2[T]
- func (vec *Vector2[T]) Set(i int, v T)
- func (vec *Vector2[T]) SetElements(x, y T)
- func (vec *Vector2[T]) SetX(x T)
- func (vec *Vector2[T]) SetY(y T)
- func (vec Vector2[T]) Shape() Shape
- func (vec Vector2[T]) SquaredLength() T
- func (vec Vector2[T]) String() string
- func (vec Vector2[T]) Sub(other Vector2[T]) Vector2[T]
- func (vec Vector2[T]) Sum() T
- func (vec Vector2[T]) Vec3() Vector3[T]
- func (vec Vector2[T]) Vec4() Vector4[T]
- func (vec Vector2[T]) X() T
- func (vec Vector2[T]) Y() T
- type Vector3
- func (vec Vector3[T]) Add(other Vector3[T]) Vector3[T]
- func (vec Vector3[T]) At(index Shape) T
- func (vec *Vector3[T]) Copy(other Vector3[T])
- func (vec Vector3[T]) Cross(other Vector3[T]) Vector3[T]
- func (vec Vector3[T]) Div(other Vector3[T]) Vector3[T]
- func (vec Vector3[T]) Dot(other Vector3[T]) T
- func (vec Vector3[T]) Get(i int) T
- func (vec Vector3[T]) Mul(other Vector3[T]) Vector3[T]
- func (vec Vector3[T]) Norm() T
- func (vec Vector3[T]) Normalize() Vector3[T]
- func (vec Vector3[T]) Normp(p T) T
- func (vec Vector3[T]) Scale(k T) Vector3[T]
- func (vec *Vector3[T]) Set(i int, v T)
- func (vec *Vector3[T]) SetElements(x, y, z T)
- func (vec *Vector3[T]) SetX(x T)
- func (vec *Vector3[T]) SetY(y T)
- func (vec *Vector3[T]) SetZ(z T)
- func (vec Vector3[T]) Shape() Shape
- func (vec Vector3[T]) SquaredLength() T
- func (vec Vector3[T]) String() string
- func (vec Vector3[T]) Sub(other Vector3[T]) Vector3[T]
- func (vec Vector3[T]) Sum() T
- func (vec Vector3[T]) Vec2() Vector2[T]
- func (vec Vector3[T]) Vec4() Vector4[T]
- func (vec Vector3[T]) X() T
- func (vec Vector3[T]) Y() T
- func (vec Vector3[T]) Z() T
- type Vector4
- func (vec Vector4[T]) Add(other Vector4[T]) Vector4[T]
- func (vec Vector4[T]) At(index Shape) T
- func (vec *Vector4[T]) Copy(other Vector4[T])
- func (vec Vector4[T]) Div(other Vector4[T]) Vector4[T]
- func (vec Vector4[T]) Dot(other Vector4[T]) T
- func (vec Vector4[T]) Get(i int) T
- func (vec Vector4[T]) Mul(other Vector4[T]) Vector4[T]
- func (vec Vector4[T]) Norm() T
- func (vec Vector4[T]) Normalize() Vector4[T]
- func (vec Vector4[T]) Normp(p T) T
- func (vec Vector4[T]) Scale(k T) Vector4[T]
- func (vec *Vector4[T]) Set(i int, v T)
- func (vec *Vector4[T]) SetElements(x, y, z, w T)
- func (vec *Vector4[T]) SetW(w T)
- func (vec *Vector4[T]) SetX(x T)
- func (vec *Vector4[T]) SetY(y T)
- func (vec *Vector4[T]) SetZ(z T)
- func (vec Vector4[T]) Shape() Shape
- func (vec Vector4[T]) SquaredLength() T
- func (vec Vector4[T]) String() string
- func (vec Vector4[T]) Sub(other Vector4[T]) Vector4[T]
- func (vec Vector4[T]) Sum() T
- func (vec Vector4[T]) Vec2() Vector2[T]
- func (vec Vector4[T]) Vec3() Vector3[T]
- func (vec Vector4[T]) W() T
- func (vec Vector4[T]) X() T
- func (vec Vector4[T]) Y() T
- func (vec Vector4[T]) Z() T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Euler ¶ added in v0.1.7
type Euler[T constraints.Float] struct { Vector3[T] Order EulerRotationOrder // XYZ, XZY, YXZ, YZX, ZXY, ZYX }
func (*Euler[T]) SetFromRotationMatrix ¶ added in v0.1.7
type EulerRotationOrder ¶ added in v0.2.3
type EulerRotationOrder int8
const ( EulerRotationOrderXYZ EulerRotationOrder = iota EulerRotationOrderXZY EulerRotationOrderYXZ EulerRotationOrderYZX EulerRotationOrderZXY EulerRotationOrderZYX )
func (EulerRotationOrder) String ¶ added in v0.2.3
func (order EulerRotationOrder) String() string
type Indices ¶ added in v0.2.13
type Indices []int
Index implements a n-dim shape
type Matrix ¶ added in v0.2.13
type Matrix[T constraints.SignedReal] struct { // contains filtered or unexported fields }
Matrix represents a MxN matrix
func IdentityN ¶ added in v0.2.13
func IdentityN[T constraints.SignedReal](n int) Matrix[T]
IdentityN creates a NxN identity matrix
func OneMxN ¶ added in v0.2.13
func OneMxN[T constraints.SignedReal](m, n int) Matrix[T]
OneMxN creates a MxN matrix which every element is 1
func ZeroMxN ¶ added in v0.2.13
func ZeroMxN[T constraints.SignedReal](m, n int) Matrix[T]
ZeroMxN creates a zero MxN matrix
func (Matrix[T]) Determinant ¶ added in v0.2.13
func (mat Matrix[T]) Determinant() T
func (Matrix[T]) SquaredLength ¶ added in v0.2.13
func (mat Matrix[T]) SquaredLength() T
type Matrix2 ¶ added in v0.2.3
type Matrix2[T constraints.SignedReal] [2 * 2]T
Matrix2 represents a 2x2 matrix
func Identity2 ¶ added in v0.2.13
func Identity2[T constraints.SignedReal]() Matrix2[T]
Identity2 creates a 2x2 identity matrix
func One2x2 ¶ added in v0.2.3
func One2x2[T constraints.SignedReal]() Matrix2[T]
One2x2 creates a 2x2 matrix which every element is 1
func Zero2x2 ¶ added in v0.2.13
func Zero2x2[T constraints.SignedReal]() Matrix2[T]
Zero2x2 creates a zero 2x2 matrix
func (Matrix2[T]) Determaint ¶ added in v0.2.3
func (mat Matrix2[T]) Determaint() T
func (*Matrix2[T]) MakeIdentity ¶ added in v0.2.3
func (*Matrix2[T]) MakeRotation ¶ added in v0.2.3
func (*Matrix2[T]) SetElements ¶ added in v0.2.3
func (Matrix2[T]) SquaredLength ¶ added in v0.2.12
func (mat Matrix2[T]) SquaredLength() T
type Matrix3 ¶ added in v0.1.7
type Matrix3[T constraints.SignedReal] [3 * 3]T
Matrix3 represents a 3x3 matrix
func Identity3 ¶ added in v0.2.13
func Identity3[T constraints.SignedReal]() Matrix3[T]
Identity3 creates a 3x3 identity matrix
func One3x3 ¶ added in v0.1.7
func One3x3[T constraints.SignedReal]() Matrix3[T]
One4x4 creates a 3x3 matrix which every element is 1
func Zero3x3 ¶ added in v0.2.13
func Zero3x3[T constraints.SignedReal]() Matrix3[T]
Zero3x3 creates a zero 3x3 matrix
func (Matrix3[T]) Determaint ¶ added in v0.1.7
func (mat Matrix3[T]) Determaint() T
func (*Matrix3[T]) MakeIdentity ¶ added in v0.1.7
func (*Matrix3[T]) MakeRotationAxis ¶ added in v0.1.7
Based on http://www.gamedev.net/reference/articles/article1199.asp
func (*Matrix3[T]) MakeRotationX ¶ added in v0.1.7
func (*Matrix3[T]) MakeRotationY ¶ added in v0.1.7
func (*Matrix3[T]) MakeRotationZ ¶ added in v0.1.7
func (*Matrix3[T]) SetElements ¶ added in v0.1.7
func (Matrix3[T]) SquaredLength ¶ added in v0.2.12
func (mat Matrix3[T]) SquaredLength() T
type Matrix4 ¶ added in v0.1.7
type Matrix4[T constraints.SignedReal] [4 * 4]T
Matrix4 represents a 4x4 matrix
func Identity4 ¶ added in v0.2.13
func Identity4[T constraints.SignedReal]() Matrix4[T]
Identity4 creates a 4x4 identity matrix
func One4x4 ¶
func One4x4[T constraints.SignedReal]() Matrix4[T]
One4x4 creates a 4x4 matrix which every element is 1
func Zero4x4 ¶ added in v0.2.13
func Zero4x4[T constraints.SignedReal]() Matrix4[T]
Zero4x4 creates a zero 4x4 matrix
func (Matrix4[T]) Determinant ¶ added in v0.1.7
func (mat Matrix4[T]) Determinant() T
func (Matrix4[T]) GetPosition ¶ added in v0.1.7
func (Matrix4[T]) GetQuaternion ¶ added in v0.1.7
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
func (Matrix4[T]) Invert ¶ added in v0.1.7
based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
func (*Matrix4[T]) MakeFromMatrix3 ¶ added in v0.1.7
func (*Matrix4[T]) MakeIdentity ¶ added in v0.1.7
func (*Matrix4[T]) MakeOrthographic ¶ added in v0.1.7
func (*Matrix4[T]) MakePerspective ¶ added in v0.1.7
func (*Matrix4[T]) MakeRotationAxis ¶ added in v0.1.7
Based on http://www.gamedev.net/reference/articles/article1199.asp
func (*Matrix4[T]) MakeRotationX ¶ added in v0.1.7
func (*Matrix4[T]) MakeRotationY ¶ added in v0.1.7
func (*Matrix4[T]) MakeRotationZ ¶ added in v0.1.7
func (*Matrix4[T]) MakeTranslation ¶ added in v0.1.7
func (*Matrix4[T]) SetElements ¶ added in v0.1.7
func (*Matrix4[T]) SetPosition ¶ added in v0.1.7
func (Matrix4[T]) SquaredLength ¶ added in v0.2.12
func (mat Matrix4[T]) SquaredLength() T
type Tensor ¶ added in v0.2.13
type Tensor[T constraints.SignedReal] interface { Shape() tuple.Tuple[int] At(index tuple.Tuple[int]) T Sum() T }
Tensor represents a tensor
func Create ¶ added in v0.2.13
func Create[T constraints.SignedReal](shape Shape) Tensor[T]
Create creates a tensor by shape
func Dot ¶ added in v0.2.13
func Dot[T constraints.SignedReal](a, b Tensor[T]) Tensor[T]
Dot computes dot product: a‧b
func Product ¶ added in v0.2.13
func Product[T constraints.SignedReal](a, b Tensor[T]) Tensor[T]
Product computes tensor product: a⊗b
func Reshape ¶ added in v0.3.0
func Reshape[T constraints.SignedReal](tensor Tensor[T], shape Shape) Tensor[T]
Reshape reshapes the tensor
func Scalar ¶ added in v0.2.13
func Scalar[T constraints.SignedReal](x T) Tensor[T]
type Vector ¶ added in v0.2.11
type Vector[T constraints.SignedReal] []T
Vector implements n-dim vector
func Linspace ¶ added in v0.2.12
func Linspace[T constraints.SignedReal](from, to T, n int) Vector[T]
Linspace creates a vector {x1=from, ..., xn=to}
func Range ¶ added in v0.2.12
func Range[T constraints.SignedReal](start, end T) Vector[T]
Range creates a vector [start, end)
func RangeN ¶ added in v0.2.12
func RangeN[T constraints.SignedReal](n T) Vector[T]
RangeN creates a vector [0, n)
func Repeat ¶ added in v0.2.13
func Repeat[T constraints.SignedReal](x T, n int) Vector[T]
Repeat creates a n-dim vector which has same value x
func Vec ¶ added in v0.2.11
func Vec[T constraints.SignedReal](elements ...T) Vector[T]
Vec creates a vector by elements
func (Vector[T]) SquaredLength ¶ added in v0.2.11
func (vec Vector[T]) SquaredLength() T
SquaredLength computes ║vec║²
type Vector2 ¶
type Vector2[T constraints.SignedReal] [2]T
Vector2 implements 2d vector
func Vec2 ¶
func Vec2[T constraints.SignedReal](x, y T) Vector2[T]
Vec2 creates a 2d vector by elements
func (*Vector2[T]) SetElements ¶ added in v0.2.11
func (vec *Vector2[T]) SetElements(x, y T)
func (Vector2[T]) SquaredLength ¶ added in v0.2.11
func (vec Vector2[T]) SquaredLength() T
type Vector3 ¶
type Vector3[T constraints.SignedReal] [3]T
Vector3 implements 3d vector
func Vec3 ¶
func Vec3[T constraints.SignedReal](x, y, z T) Vector3[T]
Vec3 creates a 3d vector by elements
func (*Vector3[T]) SetElements ¶ added in v0.2.11
func (vec *Vector3[T]) SetElements(x, y, z T)
func (Vector3[T]) SquaredLength ¶ added in v0.2.11
func (vec Vector3[T]) SquaredLength() T
type Vector4 ¶
type Vector4[T constraints.SignedReal] [4]T
Vector4 implements 4d vector
func Vec4 ¶
func Vec4[T constraints.SignedReal](x, y, z, w T) Vector4[T]
Vec4 creates a 4d vector by elements
func (*Vector4[T]) SetElements ¶ added in v0.2.11
func (vec *Vector4[T]) SetElements(x, y, z, w T)
func (Vector4[T]) SquaredLength ¶ added in v0.2.11
func (vec Vector4[T]) SquaredLength() T