math

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 1 Imported by: 13

README

math

32-bit floating point math: low allocations, hardware-accelerated

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FloatingPoint

type FloatingPoint interface {
	~float32 | ~float64
}

type Mat2Row

type Mat2Row[T FloatingPoint] [2]T

type Mat2x2

type Mat2x2[T FloatingPoint] [2]Mat2Row[T]

func (*Mat2x2[T]) Equal

func (m *Mat2x2[T]) Equal(other *Mat2x2[T], epsilon T) bool

func (*Mat2x2[T]) IsNormalized

func (m *Mat2x2[T]) IsNormalized(epsilon T) bool

func (*Mat2x2[T]) IsNull

func (m *Mat2x2[T]) IsNull(epsilon T) bool

func (*Mat2x2[T]) MultMatrix2x2

func (m *Mat2x2[T]) MultMatrix2x2(other *Mat2x2[T]) *Mat2x2[T]

func (*Mat2x2[T]) SetColMajor

func (m *Mat2x2[T]) SetColMajor(c1, c2 *Vec2[T]) *Mat2x2[T]

func (*Mat2x2[T]) SetDiagonalScalar

func (m *Mat2x2[T]) SetDiagonalScalar(s T) *Mat2x2[T]

func (*Mat2x2[T]) SetDiagonalVector

func (m *Mat2x2[T]) SetDiagonalVector(v *Vec2[T]) *Mat2x2[T]

func (*Mat2x2[T]) SetIdentity

func (m *Mat2x2[T]) SetIdentity() *Mat2x2[T]

func (*Mat2x2[T]) SetMat2x2

func (m *Mat2x2[T]) SetMat2x2(other *Mat2x2[T]) *Mat2x2[T]

func (*Mat2x2[T]) SetMat3x3

func (m *Mat2x2[T]) SetMat3x3(other *Mat3x3[T]) *Mat2x2[T]

func (*Mat2x2[T]) SetMat4x4

func (m *Mat2x2[T]) SetMat4x4(other *Mat4x4[T]) *Mat2x2[T]

func (*Mat2x2[T]) SetMultMatrix2x2

func (m *Mat2x2[T]) SetMultMatrix2x2(lhs, rhs *Mat2x2[T]) *Mat2x2[T]

func (*Mat2x2[T]) SetRowMajor

func (m *Mat2x2[T]) SetRowMajor(r1, r2 *Vec2[T]) *Mat2x2[T]

type Mat3Row

type Mat3Row[T FloatingPoint] [3]T

type Mat3x3

type Mat3x3[T FloatingPoint] [3]Mat3Row[T]

func (*Mat3x3[T]) ApplyTransform

func (m *Mat3x3[T]) ApplyTransform(other *Mat3x3[T]) *Mat3x3[T]

func (*Mat3x3[T]) Equal

func (m *Mat3x3[T]) Equal(other *Mat3x3[T], epsilon T) bool

func (*Mat3x3[T]) GetAxisAngle

func (m *Mat3x3[T]) GetAxisAngle(outAxis *Vec3[T], outAngleRad *float64)

func (*Mat3x3[T]) Inverse

func (m *Mat3x3[T]) Inverse() *Mat3x3[T]

func (*Mat3x3[T]) IsNormalized

func (m *Mat3x3[T]) IsNormalized(epsilon T) bool

func (*Mat3x3[T]) IsNull

func (m *Mat3x3[T]) IsNull(epsilon T) bool

func (*Mat3x3[T]) MultMatrix3x3

func (m *Mat3x3[T]) MultMatrix3x3(other *Mat3x3[T]) *Mat3x3[T]

func (*Mat3x3[T]) Orthonormalize

func (m *Mat3x3[T]) Orthonormalize() *Mat3x3[T]

func (*Mat3x3[T]) Proj2D

func (m *Mat3x3[T]) Proj2D(normal *Vec3[T]) *Mat3x3[T]

func (*Mat3x3[T]) RotateAroundAxis

func (m *Mat3x3[T]) RotateAroundAxis(axis *Vec3[T], angleRad float64) *Mat3x3[T]

func (*Mat3x3[T]) RotateX

func (m *Mat3x3[T]) RotateX(angleRad float64) *Mat3x3[T]

func (*Mat3x3[T]) RotateY

func (m *Mat3x3[T]) RotateY(angleRad float64) *Mat3x3[T]

func (*Mat3x3[T]) RotateZ

func (m *Mat3x3[T]) RotateZ(angleRad float64) *Mat3x3[T]

func (*Mat3x3[T]) Scale

func (m *Mat3x3[T]) Scale(x, y, z T) *Mat3x3[T]

func (*Mat3x3[T]) SetApplyTransform

func (m *Mat3x3[T]) SetApplyTransform(lhs, rhs *Mat3x3[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetAxisAngle

func (m *Mat3x3[T]) SetAxisAngle(axis *Vec3[T], angleRad float64) *Mat3x3[T]

func (*Mat3x3[T]) SetColMajor

func (m *Mat3x3[T]) SetColMajor(c1, c2, c3 *Vec3[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetDiagonalScalar

func (m *Mat3x3[T]) SetDiagonalScalar(s T) *Mat3x3[T]

func (*Mat3x3[T]) SetDiagonalVector

func (m *Mat3x3[T]) SetDiagonalVector(v *Vec3[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetIdentity

func (m *Mat3x3[T]) SetIdentity() *Mat3x3[T]

func (*Mat3x3[T]) SetMat3x3

func (m *Mat3x3[T]) SetMat3x3(other *Mat3x3[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetMat4x4

func (m *Mat3x3[T]) SetMat4x4(other *Mat4x4[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetMultMatrix3x3

func (m *Mat3x3[T]) SetMultMatrix3x3(lhs, rhs *Mat3x3[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetQuaternion

func (m *Mat3x3[T]) SetQuaternion(other *Quaternion[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetRotationAroundAxis

func (m *Mat3x3[T]) SetRotationAroundAxis(axis *Vec3[T], angleRad float64) *Mat3x3[T]

func (*Mat3x3[T]) SetRotationEulers

func (m *Mat3x3[T]) SetRotationEulers(yawRad, pitchRad, rollRad float64) *Mat3x3[T]

func (*Mat3x3[T]) SetRotationX

func (m *Mat3x3[T]) SetRotationX(pitchRad float64) *Mat3x3[T]

func (*Mat3x3[T]) SetRotationY

func (m *Mat3x3[T]) SetRotationY(yawRad float64) *Mat3x3[T]

func (*Mat3x3[T]) SetRotationZ

func (m *Mat3x3[T]) SetRotationZ(rollRad float64) *Mat3x3[T]

func (*Mat3x3[T]) SetRowMajor

func (m *Mat3x3[T]) SetRowMajor(r1, r2, r3 *Vec3[T]) *Mat3x3[T]

func (*Mat3x3[T]) SetScale

func (m *Mat3x3[T]) SetScale(x, y, z T) *Mat3x3[T]

func (*Mat3x3[T]) SetShearX

func (m *Mat3x3[T]) SetShearX(y, z T) *Mat3x3[T]

func (*Mat3x3[T]) SetShearY

func (m *Mat3x3[T]) SetShearY(x, z T) *Mat3x3[T]

func (*Mat3x3[T]) SetShearZ

func (m *Mat3x3[T]) SetShearZ(x, y T) *Mat3x3[T]

func (*Mat3x3[T]) ShearX

func (m *Mat3x3[T]) ShearX(y, z T) *Mat3x3[T]

func (*Mat3x3[T]) ShearY

func (m *Mat3x3[T]) ShearY(x, z T) *Mat3x3[T]

func (*Mat3x3[T]) ShearZ

func (m *Mat3x3[T]) ShearZ(x, y T) *Mat3x3[T]

func (*Mat3x3[T]) Transpose

func (m *Mat3x3[T]) Transpose() *Mat3x3[T]

type Mat4Row

type Mat4Row[T FloatingPoint] [4]T

type Mat4x4

type Mat4x4[T FloatingPoint] [4]Mat4Row[T]

func (*Mat4x4[T]) ApplyTransform

func (m *Mat4x4[T]) ApplyTransform(transform *Mat4x4[T]) *Mat4x4[T]

func (*Mat4x4[T]) Equal

func (m *Mat4x4[T]) Equal(other *Mat4x4[T], epsilon T) bool

func (*Mat4x4[T]) GetAxisAngle

func (m *Mat4x4[T]) GetAxisAngle(outAxis *Vec3[T], outAngleRad *float64)

func (*Mat4x4[T]) InterpolateMatrix

func (m *Mat4x4[T]) InterpolateMatrix(otherMatrix *Mat4x4[T], delta T) *Mat4x4[T]

func (*Mat4x4[T]) Inverse

func (m *Mat4x4[T]) Inverse() *Mat4x4[T]

func (*Mat4x4[T]) IsNormalized

func (m *Mat4x4[T]) IsNormalized(epsilon T) bool

func (*Mat4x4[T]) IsNull

func (m *Mat4x4[T]) IsNull(epsilon T) bool

func (*Mat4x4[T]) MultMatrix4x4

func (m *Mat4x4[T]) MultMatrix4x4(other *Mat4x4[T]) *Mat4x4[T]

func (*Mat4x4[T]) Proj3D

func (m *Mat4x4[T]) Proj3D(normal *Vec3[T]) *Mat4x4[T]

func (*Mat4x4[T]) RotateAroundAxis

func (m *Mat4x4[T]) RotateAroundAxis(axis *Vec3[T], angleRad float64) *Mat4x4[T]

func (*Mat4x4[T]) RotateX

func (m *Mat4x4[T]) RotateX(angleRad float64) *Mat4x4[T]

func (*Mat4x4[T]) RotateY

func (m *Mat4x4[T]) RotateY(angleRad float64) *Mat4x4[T]

func (*Mat4x4[T]) RotateZ

func (m *Mat4x4[T]) RotateZ(angleRad float64) *Mat4x4[T]

func (*Mat4x4[T]) Scale

func (m *Mat4x4[T]) Scale(x, y, z T) *Mat4x4[T]

func (*Mat4x4[T]) SetAxisAngle

func (m *Mat4x4[T]) SetAxisAngle(axis *Vec3[T], angleRad float64) *Mat4x4[T]

func (*Mat4x4[T]) SetColMajor

func (m *Mat4x4[T]) SetColMajor(c1, c2, c3, c4 *Vec4[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetDiagonalScalar

func (m *Mat4x4[T]) SetDiagonalScalar(s T) *Mat4x4[T]

func (*Mat4x4[T]) SetDiagonalVector

func (m *Mat4x4[T]) SetDiagonalVector(v *Vec4[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetFrustum

func (m *Mat4x4[T]) SetFrustum(left, right, bottom, top, nearVal, farVal T) *Mat4x4[T]

func (*Mat4x4[T]) SetIdentity

func (m *Mat4x4[T]) SetIdentity() *Mat4x4[T]

func (*Mat4x4[T]) SetInfinitePerspective

func (m *Mat4x4[T]) SetInfinitePerspective(fovY float64, aspectRatio, zNear T) *Mat4x4[T]

func (*Mat4x4[T]) SetInterpolate

func (m *Mat4x4[T]) SetInterpolate(lhs, rhs *Mat4x4[T], delta T) *Mat4x4[T]

func (*Mat4x4[T]) SetLookAt

func (m *Mat4x4[T]) SetLookAt(eyePosition *Vec3[T], target *Vec3[T], up *Vec3[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetMat3x3

func (m *Mat4x4[T]) SetMat3x3(other *Mat3x3[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetMat4x4

func (m *Mat4x4[T]) SetMat4x4(other *Mat4x4[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetMatrixRotationFrom

func (m *Mat4x4[T]) SetMatrixRotationFrom(other *Mat4x4[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetMultMatrix4x4

func (m *Mat4x4[T]) SetMultMatrix4x4(lhs, rhs *Mat4x4[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetOrientation

func (m *Mat4x4[T]) SetOrientation(normal *Vec3[T], up *Vec3[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetOrthographic

func (m *Mat4x4[T]) SetOrthographic(left, right, bottom, top, zNear, zFar T) *Mat4x4[T]

func (*Mat4x4[T]) SetOrthographic2D

func (m *Mat4x4[T]) SetOrthographic2D(left, right, bottom, top T) *Mat4x4[T]

func (*Mat4x4[T]) SetPerspective

func (m *Mat4x4[T]) SetPerspective(fovYRad float64, aspectRatio, zNear, zFar T) *Mat4x4[T]

func (*Mat4x4[T]) SetQuaternion

func (m *Mat4x4[T]) SetQuaternion(other *Quaternion[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetRotationAroundAxis

func (m *Mat4x4[T]) SetRotationAroundAxis(axis *Vec3[T], angleRad float64) *Mat4x4[T]

func (*Mat4x4[T]) SetRotationEulers

func (m *Mat4x4[T]) SetRotationEulers(yawRad, pitchRad, rollRad float64) *Mat4x4[T]

func (*Mat4x4[T]) SetRotationX

func (m *Mat4x4[T]) SetRotationX(pitchRad float64) *Mat4x4[T]

func (*Mat4x4[T]) SetRotationY

func (m *Mat4x4[T]) SetRotationY(yawRad float64) *Mat4x4[T]

func (*Mat4x4[T]) SetRotationZ

func (m *Mat4x4[T]) SetRotationZ(rollRad float64) *Mat4x4[T]

func (*Mat4x4[T]) SetRowMajor

func (m *Mat4x4[T]) SetRowMajor(r1, r2, r3, r4 *Vec4[T]) *Mat4x4[T]

func (*Mat4x4[T]) SetScale

func (m *Mat4x4[T]) SetScale(x, y, z T) *Mat4x4[T]

func (*Mat4x4[T]) SetShearX

func (m *Mat4x4[T]) SetShearX(y, z T) *Mat4x4[T]

func (*Mat4x4[T]) SetShearY

func (m *Mat4x4[T]) SetShearY(x, z T) *Mat4x4[T]

func (*Mat4x4[T]) SetShearZ

func (m *Mat4x4[T]) SetShearZ(x, y T) *Mat4x4[T]

func (*Mat4x4[T]) SetTranslation

func (m *Mat4x4[T]) SetTranslation(x, y, z T) *Mat4x4[T]

func (*Mat4x4[T]) ShearX

func (m *Mat4x4[T]) ShearX(y, z T) *Mat4x4[T]

func (*Mat4x4[T]) ShearY

func (m *Mat4x4[T]) ShearY(x, z T) *Mat4x4[T]

func (*Mat4x4[T]) ShearZ

func (m *Mat4x4[T]) ShearZ(x, y T) *Mat4x4[T]

func (*Mat4x4[T]) Translate

func (m *Mat4x4[T]) Translate(x, y, z T) *Mat4x4[T]

func (*Mat4x4[T]) Transpose

func (m *Mat4x4[T]) Transpose() *Mat4x4[T]

type Quaternion

type Quaternion[T FloatingPoint] struct {
	X, Y, Z, W T
}

func (*Quaternion[T]) Angle

func (q *Quaternion[T]) Angle() T

func (*Quaternion[T]) Conjugate

func (q *Quaternion[T]) Conjugate() *Quaternion[T]

func (*Quaternion[T]) DotProduct

func (q *Quaternion[T]) DotProduct(other *Quaternion[T]) T

func (*Quaternion[T]) Equal

func (q *Quaternion[T]) Equal(other *Quaternion[T], epsilon T) bool

func (*Quaternion[T]) EulerAngles

func (q *Quaternion[T]) EulerAngles() (yaw, pitch, roll T)

func (*Quaternion[T]) Exp

func (q *Quaternion[T]) Exp() *Quaternion[T]

func (*Quaternion[T]) GetAxis

func (q *Quaternion[T]) GetAxis(outAxis *Vec3[T])

func (*Quaternion[T]) GreaterThan

func (q *Quaternion[T]) GreaterThan(other *Quaternion[T]) bool

func (*Quaternion[T]) GreaterThanEqual

func (q *Quaternion[T]) GreaterThanEqual(other *Quaternion[T]) bool

func (*Quaternion[T]) Inverse

func (q *Quaternion[T]) Inverse() *Quaternion[T]

func (*Quaternion[T]) Len

func (q *Quaternion[T]) Len() T

func (*Quaternion[T]) LenSqr

func (q *Quaternion[T]) LenSqr() T

func (*Quaternion[T]) Lerp

func (q *Quaternion[T]) Lerp(other *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) LessThan

func (q *Quaternion[T]) LessThan(other *Quaternion[T]) bool

func (*Quaternion[T]) LessThanEqual

func (q *Quaternion[T]) LessThanEqual(other *Quaternion[T]) bool

func (*Quaternion[T]) Log

func (q *Quaternion[T]) Log() *Quaternion[T]

func (*Quaternion[T]) Mix

func (q *Quaternion[T]) Mix(other *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) MultQuaternion

func (q *Quaternion[T]) MultQuaternion(other *Quaternion[T]) *Quaternion[T]

func (*Quaternion[T]) Normalize

func (q *Quaternion[T]) Normalize() *Quaternion[T]

func (*Quaternion[T]) Pitch

func (q *Quaternion[T]) Pitch() T

func (*Quaternion[T]) Pow

func (q *Quaternion[T]) Pow(y T) *Quaternion[T]

func (*Quaternion[T]) Roll

func (q *Quaternion[T]) Roll() T

func (*Quaternion[T]) Rotate

func (q *Quaternion[T]) Rotate(axis *Vec3[T], angleRad float64) *Quaternion[T]

func (*Quaternion[T]) RotateNormalizedAxis

func (q *Quaternion[T]) RotateNormalizedAxis(unitAxis *Vec3[T], angleRad float64) *Quaternion[T]

func (*Quaternion[T]) RotateX

func (q *Quaternion[T]) RotateX(angleRad float64) *Quaternion[T]

func (*Quaternion[T]) RotateY

func (q *Quaternion[T]) RotateY(angleRad float64) *Quaternion[T]

func (*Quaternion[T]) RotateZ

func (q *Quaternion[T]) RotateZ(angleRad float64) *Quaternion[T]

func (*Quaternion[T]) SetAxisAngle

func (q *Quaternion[T]) SetAxisAngle(axis *Vec3[T], angle T) *Quaternion[T]

func (*Quaternion[T]) SetConjugate

func (q *Quaternion[T]) SetConjugate(other *Quaternion[T]) *Quaternion[T]

func (*Quaternion[T]) SetEulerAngles

func (q *Quaternion[T]) SetEulerAngles(rollRad, yawRad, pitchRad float64) *Quaternion[T]

func (*Quaternion[T]) SetIdentity

func (q *Quaternion[T]) SetIdentity() *Quaternion[T]

func (*Quaternion[T]) SetIntermediate

func (q *Quaternion[T]) SetIntermediate(prev *Quaternion[T], current *Quaternion[T], next *Quaternion[T]) *Quaternion[T]

func (*Quaternion[T]) SetLerp

func (q *Quaternion[T]) SetLerp(lhs, rhs *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) SetMat3x3

func (q *Quaternion[T]) SetMat3x3(m *Mat3x3[T]) *Quaternion[T]

func (*Quaternion[T]) SetMat4x4

func (q *Quaternion[T]) SetMat4x4(m *Mat4x4[T]) *Quaternion[T]

func (*Quaternion[T]) SetMix

func (q *Quaternion[T]) SetMix(lhs, rhs *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) SetMultQuaternion

func (q *Quaternion[T]) SetMultQuaternion(lhs, rhs *Quaternion[T]) *Quaternion[T]

func (*Quaternion[T]) SetQuaternion

func (q *Quaternion[T]) SetQuaternion(other *Quaternion[T]) *Quaternion[T]

func (*Quaternion[T]) SetRotateX

func (q *Quaternion[T]) SetRotateX(angle T) *Quaternion[T]

func (*Quaternion[T]) SetRotateY

func (q *Quaternion[T]) SetRotateY(angle T) *Quaternion[T]

func (*Quaternion[T]) SetRotateZ

func (q *Quaternion[T]) SetRotateZ(angle T) *Quaternion[T]

func (*Quaternion[T]) SetShortMix

func (q *Quaternion[T]) SetShortMix(lhs, rhs *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) SetSlerp

func (q *Quaternion[T]) SetSlerp(lhs, rhs *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) SetSquad

func (q *Quaternion[T]) SetSquad(q1, q2, s1, s2 *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) SetVectorRotation

func (q *Quaternion[T]) SetVectorRotation(origin *Vec3[T], destination *Vec3[T]) *Quaternion[T]

func (*Quaternion[T]) ShortMix

func (q *Quaternion[T]) ShortMix(other *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) Slerp

func (q *Quaternion[T]) Slerp(other *Quaternion[T], delta T) *Quaternion[T]

func (*Quaternion[T]) Yaw

func (q *Quaternion[T]) Yaw() T

type Vec2

type Vec2[T FloatingPoint] struct {
	X T
	Y T
}

func (*Vec2[T]) AddVec2

func (v *Vec2[T]) AddVec2(other *Vec2[T]) *Vec2[T]

func (*Vec2[T]) DotProduct

func (v *Vec2[T]) DotProduct(other *Vec2[T]) T

func (*Vec2[T]) Equal

func (v *Vec2[T]) Equal(other *Vec2[T], epsilon T) bool

func (*Vec2[T]) GreaterThan

func (v *Vec2[T]) GreaterThan(other *Vec2[T]) bool

func (*Vec2[T]) GreaterThanEqual

func (v *Vec2[T]) GreaterThanEqual(other *Vec2[T]) bool

func (*Vec2[T]) Len

func (v *Vec2[T]) Len() T

func (*Vec2[T]) LenSqr

func (v *Vec2[T]) LenSqr() T

func (*Vec2[T]) Lerp

func (v *Vec2[T]) Lerp(other *Vec2[T], delta T) *Vec2[T]

func (*Vec2[T]) LessThan

func (v *Vec2[T]) LessThan(other *Vec2[T]) bool

func (*Vec2[T]) LessThanEqual

func (v *Vec2[T]) LessThanEqual(other *Vec2[T]) bool

func (*Vec2[T]) Normalize

func (v *Vec2[T]) Normalize() *Vec2[T]

func (*Vec2[T]) Rotate

func (v *Vec2[T]) Rotate(angleRad float64) *Vec2[T]

func (*Vec2[T]) Scale

func (v *Vec2[T]) Scale(scale T) *Vec2[T]

func (*Vec2[T]) SetHomogenousVec3

func (v *Vec2[T]) SetHomogenousVec3(in *Vec3[T]) *Vec2[T]

func (*Vec2[T]) SetHomogenousVec4

func (v *Vec2[T]) SetHomogenousVec4(in *Vec4[T]) *Vec2[T]

func (*Vec2[T]) SetLinearGradient

func (v *Vec2[T]) SetLinearGradient(point0, point1, position *Vec2[T]) T

func (*Vec2[T]) SetVec2

func (v *Vec2[T]) SetVec2(in *Vec3[T]) *Vec2[T]

func (*Vec2[T]) SetVec3

func (v *Vec2[T]) SetVec3(in *Vec3[T]) *Vec2[T]

func (*Vec2[T]) SetVec4

func (v *Vec2[T]) SetVec4(in *Vec4[T]) *Vec2[T]

func (*Vec2[T]) SubtractVec2

func (v *Vec2[T]) SubtractVec2(other *Vec2[T]) *Vec2[T]

func (*Vec2[T]) Transform

func (v *Vec2[T]) Transform(m *Mat2x2[T]) *Vec2[T]

func (*Vec2[T]) TransformHomogenous

func (v *Vec2[T]) TransformHomogenous(m *Mat3x3[T]) *Vec2[T]

type Vec3

type Vec3[T FloatingPoint] struct {
	X T
	Y T
	Z T
}

func (*Vec3[T]) AddVec3

func (v *Vec3[T]) AddVec3(other *Vec3[T]) *Vec3[T]

func (*Vec3[T]) CrossProduct

func (v *Vec3[T]) CrossProduct(other *Vec3[T]) *Vec3[T]

func (*Vec3[T]) DotProduct

func (v *Vec3[T]) DotProduct(other *Vec3[T]) T

func (*Vec3[T]) Equal

func (v *Vec3[T]) Equal(other *Vec3[T], epsilon T) bool

func (*Vec3[T]) GreaterThan

func (v *Vec3[T]) GreaterThan(other *Vec3[T]) bool

func (*Vec3[T]) GreaterThanEqual

func (v *Vec3[T]) GreaterThanEqual(other *Vec3[T]) bool

func (*Vec3[T]) Len

func (v *Vec3[T]) Len() T

func (*Vec3[T]) LenSqr

func (v *Vec3[T]) LenSqr() T

func (*Vec3[T]) Lerp

func (v *Vec3[T]) Lerp(other *Vec3[T], delta T) *Vec3[T]

func (*Vec3[T]) LessThan

func (v *Vec3[T]) LessThan(other *Vec3[T]) bool

func (*Vec3[T]) LessThanEqual

func (v *Vec3[T]) LessThanEqual(other *Vec3[T]) bool

func (*Vec3[T]) Normalize

func (v *Vec3[T]) Normalize() *Vec3[T]

func (*Vec3[T]) Orthonormalize

func (v *Vec3[T]) Orthonormalize(other *Vec3[T]) *Vec3[T]

func (*Vec3[T]) Rotate

func (v *Vec3[T]) Rotate(angleRad float64, axis *Vec3[T]) *Vec3[T]

func (*Vec3[T]) RotateWithQuaternion

func (v *Vec3[T]) RotateWithQuaternion(q *Quaternion[T]) *Vec3[T]

func (*Vec3[T]) RotateX

func (v *Vec3[T]) RotateX(angleRad float64) *Vec3[T]

func (*Vec3[T]) RotateY

func (v *Vec3[T]) RotateY(angleRad float64) *Vec3[T]

func (*Vec3[T]) RotateZ

func (v *Vec3[T]) RotateZ(angleRad float64) *Vec3[T]

func (*Vec3[T]) Scale

func (v *Vec3[T]) Scale(scale T) *Vec3[T]

func (*Vec3[T]) SetAddVec3

func (v *Vec3[T]) SetAddVec3(lhs, rhs *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetClosestPointOnLine

func (v *Vec3[T]) SetClosestPointOnLine(point, endpoint1, endpoint2 *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetCrossProduct

func (v *Vec3[T]) SetCrossProduct(lhs, rhs *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetHomogenousVec4

func (v *Vec3[T]) SetHomogenousVec4(in *Vec4[T]) *Vec3[T]

func (*Vec3[T]) SetLerp

func (v *Vec3[T]) SetLerp(lhs, rhs *Vec3[T], delta T) *Vec3[T]

func (*Vec3[T]) SetNormalizeVec3

func (v *Vec3[T]) SetNormalizeVec3(input *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetRotate

func (v *Vec3[T]) SetRotate(input *Vec3[T], angleRad float64, axis *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetRotateWithQuaternion

func (v *Vec3[T]) SetRotateWithQuaternion(input *Vec3[T], q *Quaternion[T]) *Vec3[T]

func (*Vec3[T]) SetRotateX

func (v *Vec3[T]) SetRotateX(input *Vec3[T], angleRad float64) *Vec3[T]

func (*Vec3[T]) SetRotateY

func (v *Vec3[T]) SetRotateY(input *Vec3[T], angleRad float64) *Vec3[T]

func (*Vec3[T]) SetRotateZ

func (v *Vec3[T]) SetRotateZ(input *Vec3[T], angleRad float64) *Vec3[T]

func (*Vec3[T]) SetSubtractVec3

func (v *Vec3[T]) SetSubtractVec3(lhs, rhs *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetTransform

func (v *Vec3[T]) SetTransform(input *Vec3[T], m *Mat3x3[T]) *Vec3[T]

func (*Vec3[T]) SetTransformHomogenous

func (v *Vec3[T]) SetTransformHomogenous(input *Vec3[T], m *Mat4x4[T]) *Vec3[T]

func (*Vec3[T]) SetTriangleNormal

func (v *Vec3[T]) SetTriangleNormal(point1, point2, point3 *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetVec2

func (v *Vec3[T]) SetVec2(in *Vec2[T]) *Vec3[T]

func (*Vec3[T]) SetVec3

func (v *Vec3[T]) SetVec3(in *Vec3[T]) *Vec3[T]

func (*Vec3[T]) SetVec4

func (v *Vec3[T]) SetVec4(in *Vec4[T]) *Vec3[T]

func (*Vec3[T]) SubtractVec3

func (v *Vec3[T]) SubtractVec3(other *Vec3[T]) *Vec3[T]

func (*Vec3[T]) Transform

func (v *Vec3[T]) Transform(m *Mat3x3[T]) *Vec3[T]

func (*Vec3[T]) TransformHomogenous

func (v *Vec3[T]) TransformHomogenous(m *Mat4x4[T]) *Vec3[T]

type Vec4

type Vec4[T FloatingPoint] struct {
	X T
	Y T
	Z T
	W T
}

func (*Vec4[T]) AddVec4

func (v *Vec4[T]) AddVec4(other *Vec4[T]) *Vec4[T]

func (*Vec4[T]) DotProduct

func (v *Vec4[T]) DotProduct(other *Vec4[T]) T

func (*Vec4[T]) Equal

func (v *Vec4[T]) Equal(other *Vec4[T], epsilon T) bool

func (*Vec4[T]) GreaterThan

func (v *Vec4[T]) GreaterThan(other *Vec4[T]) bool

func (*Vec4[T]) GreaterThanEqual

func (v *Vec4[T]) GreaterThanEqual(other *Vec4[T]) bool

func (*Vec4[T]) Len

func (v *Vec4[T]) Len() T

func (*Vec4[T]) LenSqr

func (v *Vec4[T]) LenSqr() T

func (*Vec4[T]) Lerp

func (v *Vec4[T]) Lerp(other *Vec4[T], delta T) *Vec4[T]

func (*Vec4[T]) LessThan

func (v *Vec4[T]) LessThan(other *Vec4[T]) bool

func (*Vec4[T]) LessThanEqual

func (v *Vec4[T]) LessThanEqual(other *Vec4[T]) bool

func (*Vec4[T]) Normalize

func (v *Vec4[T]) Normalize() *Vec4[T]

func (*Vec4[T]) Rotate

func (v *Vec4[T]) Rotate(angleRad float64, normal *Vec3[T]) *Vec4[T]

func (*Vec4[T]) RotateWithQuaternion

func (v *Vec4[T]) RotateWithQuaternion(q *Quaternion[T]) *Vec4[T]

func (*Vec4[T]) RotateX

func (v *Vec4[T]) RotateX(angleRad float64) *Vec4[T]

func (*Vec4[T]) RotateY

func (v *Vec4[T]) RotateY(angleRad float64) *Vec4[T]

func (*Vec4[T]) RotateZ

func (v *Vec4[T]) RotateZ(angleRad float64) *Vec4[T]

func (*Vec4[T]) Scale

func (v *Vec4[T]) Scale(scale T) *Vec4[T]

func (*Vec4[T]) SetAddVec4

func (v *Vec4[T]) SetAddVec4(lhs *Vec4[T], rhs *Vec4[T]) *Vec4[T]

func (*Vec4[T]) SetLerp

func (v *Vec4[T]) SetLerp(lhs *Vec4[T], rhs *Vec4[T], delta T) *Vec4[T]

func (*Vec4[T]) SetNormalizeVec4

func (v *Vec4[T]) SetNormalizeVec4(input *Vec4[T]) *Vec4[T]

func (*Vec4[T]) SetRotate

func (v *Vec4[T]) SetRotate(input *Vec4[T], angleRad float64, normal *Vec3[T]) *Vec4[T]

func (*Vec4[T]) SetRotateWithQuaternion

func (v *Vec4[T]) SetRotateWithQuaternion(input *Vec4[T], q *Quaternion[T]) *Vec4[T]

func (*Vec4[T]) SetRotateX

func (v *Vec4[T]) SetRotateX(input *Vec4[T], angleRad float64) *Vec4[T]

func (*Vec4[T]) SetRotateY

func (v *Vec4[T]) SetRotateY(input *Vec4[T], angleRad float64) *Vec4[T]

func (*Vec4[T]) SetRotateZ

func (v *Vec4[T]) SetRotateZ(input *Vec4[T], angleRad float64) *Vec4[T]

func (*Vec4[T]) SetScale

func (v *Vec4[T]) SetScale(input *Vec4[T], scale T) *Vec4[T]

func (*Vec4[T]) SetSubtractVec4

func (v *Vec4[T]) SetSubtractVec4(lhs *Vec4[T], rhs *Vec4[T]) *Vec4[T]

func (*Vec4[T]) SetTransform

func (v *Vec4[T]) SetTransform(input *Vec4[T], m *Mat4x4[T]) *Vec4[T]

func (*Vec4[T]) SetTransformHomogenous

func (v *Vec4[T]) SetTransformHomogenous(input *Vec4[T], m *Mat4x4[T]) *Vec4[T]

func (*Vec4[T]) SetVec2

func (v *Vec4[T]) SetVec2(in *Vec2[T]) *Vec4[T]

func (*Vec4[T]) SetVec3

func (v *Vec4[T]) SetVec3(in *Vec3[T]) *Vec4[T]

func (*Vec4[T]) SetVec4

func (v *Vec4[T]) SetVec4(in *Vec4[T]) *Vec4[T]

func (*Vec4[T]) SubtractVec4

func (v *Vec4[T]) SubtractVec4(other *Vec4[T]) *Vec4[T]

func (*Vec4[T]) Transform

func (v *Vec4[T]) Transform(m *Mat4x4[T]) *Vec4[T]

func (*Vec4[T]) TransformHomogenous

func (v *Vec4[T]) TransformHomogenous(m *Mat4x4[T]) *Vec4[T]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL