Documentation
¶
Index ¶
- type Euler
- type EulerRotationOrder
- type Matrix2
- func (mat Matrix2[T]) Add(other Matrix2[T]) Matrix2[T]
- func (mat Matrix2[T]) Determaint() T
- func (mat Matrix2[T]) Div(v 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]) Hadamard(other Matrix2[T]) Matrix2[T]
- func (mat Matrix2[T]) Invert() Matrix2[T]
- func (mat Matrix2[T]) Length() 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(v T) Matrix2[T]
- func (mat Matrix2[T]) Normalize() Matrix2[T]
- func (mat *Matrix2[T]) SetElements(n11, n12, n21, n22 T) *Matrix2[T]
- 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]) Determaint() T
- func (mat Matrix3[T]) Div(v 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]) Hadamard(other Matrix3[T]) Matrix3[T]
- func (mat Matrix3[T]) Invert() Matrix3[T]
- func (mat Matrix3[T]) Length() 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(v T) Matrix3[T]
- func (mat Matrix3[T]) Normalize() Matrix3[T]
- func (mat *Matrix3[T]) SetElements(n11, n12, n13, n21, n22, n23, n31, n32, n33 T) *Matrix3[T]
- 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]) 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(v 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]) GetPosition() Vector3[T]
- func (mat Matrix4[T]) GetQuaternion() Vector4[T]
- func (mat Matrix4[T]) Hadamard(other Matrix4[T]) Matrix4[T]
- func (mat Matrix4[T]) Invert() Matrix4[T]
- func (mat Matrix4[T]) Length() 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(v T) Matrix4[T]
- func (mat Matrix4[T]) Normalize() Matrix4[T]
- func (mat *Matrix4[T]) SetElements(...) *Matrix4[T]
- func (mat *Matrix4[T]) SetPosition(pos Vector3[T]) *Matrix4[T]
- 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 Vector
- func (vec Vector[T]) Add(other Vector[T]) Vector[T]
- func (vec Vector[T]) Data() []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]) Get(i int) T
- func (vec Vector[T]) Less(i, j int) bool
- 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]) SquaredLength() T
- func (vec Vector[T]) Sub(other Vector[T]) Vector[T]
- func (vec Vector[T]) Sum() T
- func (vec Vector[T]) Swap(i, j int)
- type Vector2
- func (vec Vector2[T]) Add(other Vector2[T]) Vector2[T]
- func (vec *Vector2[T]) Copy(other Vector2[T])
- func (vec Vector2[T]) Cross(other Vector2[T]) T
- func (vec Vector2[T]) Dim() int
- func (vec Vector2[T]) Div(k T) Vector2[T]
- func (vec Vector2[T]) Dot(other Vector2[T]) T
- func (vec Vector2[T]) Get(i int) T
- func (vec Vector2[T]) Hadamard(other Vector2[T]) Vector2[T]
- func (vec Vector2[T]) Length() T
- func (vec Vector2[T]) Mul(k T) Vector2[T]
- func (vec Vector2[T]) Normalize() 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]) 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]) Copy(other Vector3[T])
- func (vec Vector3[T]) Cross(other Vector3[T]) Vector3[T]
- func (vec Vector3[T]) Dim() int
- func (vec Vector3[T]) Div(k T) Vector3[T]
- func (vec Vector3[T]) Dot(other Vector3[T]) T
- func (vec Vector3[T]) Get(i int) T
- func (vec Vector3[T]) Hadamard(other Vector3[T]) Vector3[T]
- func (vec Vector3[T]) Length() T
- func (vec Vector3[T]) Mul(k T) Vector3[T]
- func (vec Vector3[T]) Normalize() 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]) 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]) 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]) Copy(other Vector4[T])
- func (vec Vector4[T]) Dim() int
- func (vec Vector4[T]) Div(k T) Vector4[T]
- func (vec Vector4[T]) Dot(other Vector4[T]) T
- func (vec Vector4[T]) Get(i int) T
- func (vec Vector4[T]) Hadamard(other Vector4[T]) Vector4[T]
- func (vec Vector4[T]) Length() T
- func (vec Vector4[T]) Mul(k T) Vector4[T]
- func (vec Vector4[T]) Normalize() 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]) 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]) 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 ¶
This section is empty.
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 Matrix2 ¶ added in v0.2.3
type Matrix2[T constraints.SignedReal] [2 * 2]T
func One2x2 ¶ added in v0.2.3
func One2x2[T constraints.SignedReal]() Matrix2[T]
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
func One3x3 ¶ added in v0.1.7
func One3x3[T constraints.SignedReal]() Matrix3[T]
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
func One4x4 ¶
func One4x4[T constraints.SignedReal]() Matrix4[T]
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 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 Vec ¶ added in v0.2.11
func Vec[T constraints.SignedReal](elements ...T) Vector[T]
func (Vector[T]) SquaredLength ¶ added in v0.2.11
func (vec Vector[T]) SquaredLength() T
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]
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]
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]
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
Click to show internal directories.
Click to hide internal directories.