vec

package
v0.0.0-...-e6cdf45 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quaternion

type Quaternion [4]float32

func (*Quaternion) Add

func (v *Quaternion) Add(v1 Quaternion) *Quaternion

func (*Quaternion) AddC

func (v *Quaternion) AddC(c float32) *Quaternion

func (*Quaternion) Axis

func (v *Quaternion) Axis() Vector

func (*Quaternion) Clamp

func (v *Quaternion) Clamp(min, max Quaternion) *Quaternion

func (*Quaternion) Clone

func (v *Quaternion) Clone() *Quaternion

func (*Quaternion) Conjugate

func (v *Quaternion) Conjugate() *Quaternion

func (*Quaternion) CopyFrom

func (v *Quaternion) CopyFrom(start int, v1 Vector) *Quaternion

func (*Quaternion) CopyTo

func (v *Quaternion) CopyTo(start int, v1 Vector) Vector

func (*Quaternion) Distance

func (v *Quaternion) Distance(v1 Quaternion) float32

func (*Quaternion) DistanceSqr

func (v *Quaternion) DistanceSqr(v1 Quaternion) float32

func (*Quaternion) DivC

func (v *Quaternion) DivC(c float32) *Quaternion

func (*Quaternion) DivCAdd

func (v *Quaternion) DivCAdd(c float32, v1 Quaternion) *Quaternion

func (*Quaternion) DivCSub

func (v *Quaternion) DivCSub(c float32, v1 Quaternion) *Quaternion

func (*Quaternion) Dot

func (v *Quaternion) Dot(v1 Quaternion) float32

func (*Quaternion) FillC

func (v *Quaternion) FillC(c float32) *Quaternion

func (*Quaternion) Interpolate

func (v *Quaternion) Interpolate(v1 Quaternion, t float32) *Quaternion

func (*Quaternion) Magnitude

func (v *Quaternion) Magnitude() float32

func (*Quaternion) MulC

func (v *Quaternion) MulC(c float32) *Quaternion

func (*Quaternion) MulCAdd

func (v *Quaternion) MulCAdd(c float32, v1 Quaternion) *Quaternion

func (*Quaternion) MulCSub

func (v *Quaternion) MulCSub(c float32, v1 Quaternion) *Quaternion

func (*Quaternion) Multiply

func (v *Quaternion) Multiply(v1 Quaternion) *Quaternion

func (*Quaternion) Neg

func (v *Quaternion) Neg() *Quaternion

func (*Quaternion) Normal

func (v *Quaternion) Normal() *Quaternion

func (*Quaternion) NormalFast

func (v *Quaternion) NormalFast() *Quaternion

func (*Quaternion) Pitch

func (v *Quaternion) Pitch() float32

func (*Quaternion) Product

func (a *Quaternion) Product(b Quaternion) *Quaternion

func (*Quaternion) Reflect

func (v *Quaternion) Reflect(n Quaternion) *Quaternion

func (*Quaternion) Refract

func (v *Quaternion) Refract(n Quaternion, ni, nt float32) (*Quaternion, bool)

func (*Quaternion) Roll

func (v *Quaternion) Roll() float32

func (*Quaternion) Slerp

func (v *Quaternion) Slerp(v1 Quaternion, time, spin float32) *Quaternion

func (*Quaternion) SlerpLong

func (v *Quaternion) SlerpLong(v1 Quaternion, time, spin float32) *Quaternion

func (*Quaternion) Slice

func (v *Quaternion) Slice(start, end int) Vector

func (*Quaternion) Sub

func (v *Quaternion) Sub(v1 Quaternion) *Quaternion

func (*Quaternion) SubC

func (v *Quaternion) SubC(c float32) *Quaternion

func (*Quaternion) Sum

func (v *Quaternion) Sum() float32

func (*Quaternion) SumSqr

func (v *Quaternion) SumSqr() float32

func (*Quaternion) Theta

func (v *Quaternion) Theta() float32

func (*Quaternion) Vector

func (v *Quaternion) Vector() Vector

func (*Quaternion) XYZ

func (v *Quaternion) XYZ() (float32, float32, float32)

func (*Quaternion) XYZW

func (v *Quaternion) XYZW() (float32, float32, float32, float32)

func (*Quaternion) Yaw

func (v *Quaternion) Yaw() float32

type Vector

type Vector []float32

func New

func New(size int) Vector

func NewFrom

func NewFrom(v ...float32) Vector

func (Vector) Add

func (v Vector) Add(v1 Vector) Vector

func (Vector) AddC

func (v Vector) AddC(c float32) Vector

func (Vector) Axis

func (v Vector) Axis() Vector

func (Vector) Clamp

func (v Vector) Clamp(min, max Vector) Vector

func (Vector) Clone

func (v Vector) Clone() Vector

func (Vector) Conjugate

func (v Vector) Conjugate() Vector

func (Vector) CopyFrom

func (v Vector) CopyFrom(start int, v1 Vector) Vector

func (Vector) CopyTo

func (v Vector) CopyTo(start int, v1 Vector) Vector

func (Vector) Cross

func (v Vector) Cross(v1 Vector) Vector

func (Vector) Distance

func (v Vector) Distance(v1 Vector) float32

func (Vector) DistanceSqr

func (v Vector) DistanceSqr(v1 Vector) float32

func (Vector) DivC

func (v Vector) DivC(c float32) Vector

func (Vector) DivCAdd

func (v Vector) DivCAdd(c float32, v1 Vector) Vector

func (Vector) DivCSub

func (v Vector) DivCSub(c float32, v1 Vector) Vector

func (Vector) Dot

func (v Vector) Dot(v1 Vector) float32

func (Vector) FillC

func (v Vector) FillC(c float32) Vector

func (Vector) Interpolate

func (v Vector) Interpolate(v1 Vector, t float32) Vector

func (Vector) Magnitude

func (v Vector) Magnitude() float32

func (Vector) MulC

func (v Vector) MulC(c float32) Vector

func (Vector) MulCAdd

func (v Vector) MulCAdd(c float32, v1 Vector) Vector

func (Vector) MulCSub

func (v Vector) MulCSub(c float32, v1 Vector) Vector

func (Vector) Multiply

func (v Vector) Multiply(v1 Vector) Vector

func (Vector) Neg

func (v Vector) Neg() Vector

func (Vector) Normal

func (v Vector) Normal() Vector

func (Vector) NormalFast

func (v Vector) NormalFast() Vector

func (Vector) Pitch

func (v Vector) Pitch() float32

func (Vector) Product

func (a Vector) Product(b Quaternion) Vector

func (Vector) Reflect

func (v Vector) Reflect(n Vector) Vector

func (Vector) Refract2D

func (v Vector) Refract2D(n Vector, ni, nt float32) (Vector, bool)

func (Vector) Refract3D

func (v Vector) Refract3D(n Vector, ni, nt float32) (Vector, bool)

func (Vector) Roll

func (v Vector) Roll() float32

func (Vector) Slerp

func (v Vector) Slerp(v1 Vector, time, spin float32) Vector

func (Vector) SlerpLong

func (v Vector) SlerpLong(v1 Vector, time, spin float32) Vector

func (Vector) Slice

func (v Vector) Slice(start, end int) Vector

func (Vector) Sub

func (v Vector) Sub(v1 Vector) Vector

func (Vector) SubC

func (v Vector) SubC(c float32) Vector

func (Vector) Sum

func (v Vector) Sum() float32

func (Vector) SumSqr

func (v Vector) SumSqr() float32

func (Vector) Theta

func (v Vector) Theta() float32

func (Vector) XY

func (v Vector) XY() (float32, float32)

func (Vector) XYZ

func (v Vector) XYZ() (float32, float32, float32)

func (Vector) XYZW

func (v Vector) XYZW() (float32, float32, float32, float32)

func (Vector) Yaw

func (v Vector) Yaw() float32

type Vector2D

type Vector2D [2]float32

func (*Vector2D) Add

func (v *Vector2D) Add(v1 Vector2D) *Vector2D

func (*Vector2D) AddC

func (v *Vector2D) AddC(c float32) *Vector2D

func (*Vector2D) Clamp

func (v *Vector2D) Clamp(min, max Vector2D) *Vector2D

func (*Vector2D) Clone

func (v *Vector2D) Clone() *Vector2D

func (*Vector2D) CopyFrom

func (v *Vector2D) CopyFrom(start int, v1 Vector) *Vector2D

func (*Vector2D) CopyTo

func (v *Vector2D) CopyTo(start int, v1 Vector) Vector

func (*Vector2D) Distance

func (v *Vector2D) Distance(v1 Vector2D) float32

func (*Vector2D) DistanceSqr

func (v *Vector2D) DistanceSqr(v1 Vector2D) float32

func (*Vector2D) DivC

func (v *Vector2D) DivC(c float32) *Vector2D

func (*Vector2D) DivCAdd

func (v *Vector2D) DivCAdd(c float32, v1 Vector2D) *Vector2D

func (*Vector2D) DivCSub

func (v *Vector2D) DivCSub(c float32, v1 Vector2D) *Vector2D

func (*Vector2D) Dot

func (v *Vector2D) Dot(v1 Vector2D) float32

func (*Vector2D) FillC

func (v *Vector2D) FillC(c float32) *Vector2D

func (*Vector2D) Interpolate

func (v *Vector2D) Interpolate(v1 Vector2D, t float32) *Vector2D

func (*Vector2D) Magnitude

func (v *Vector2D) Magnitude() float32

func (*Vector2D) MulC

func (v *Vector2D) MulC(c float32) *Vector2D

func (*Vector2D) MulCAdd

func (v *Vector2D) MulCAdd(c float32, v1 Vector2D) *Vector2D

func (*Vector2D) MulCSub

func (v *Vector2D) MulCSub(c float32, v1 Vector2D) *Vector2D

func (*Vector2D) Multiply

func (v *Vector2D) Multiply(v1 Vector2D) *Vector2D

func (*Vector2D) Neg

func (v *Vector2D) Neg() *Vector2D

func (*Vector2D) Normal

func (v *Vector2D) Normal() *Vector2D

func (*Vector2D) NormalFast

func (v *Vector2D) NormalFast() *Vector2D

func (*Vector2D) Reflect

func (v *Vector2D) Reflect(n Vector2D) *Vector2D

func (*Vector2D) Refract

func (v *Vector2D) Refract(n Vector2D, ni, nt float32) (*Vector2D, bool)

func (*Vector2D) Slice

func (v *Vector2D) Slice(start, end int) Vector

func (*Vector2D) Sub

func (v *Vector2D) Sub(v1 Vector2D) *Vector2D

func (*Vector2D) SubC

func (v *Vector2D) SubC(c float32) *Vector2D

func (*Vector2D) Sum

func (v *Vector2D) Sum() float32

func (*Vector2D) SumSqr

func (v *Vector2D) SumSqr() float32

func (*Vector2D) Vector

func (v *Vector2D) Vector() Vector

func (*Vector2D) XY

func (v *Vector2D) XY() (float32, float32)

type Vector3D

type Vector3D [3]float32

func (*Vector3D) Add

func (v *Vector3D) Add(v1 Vector3D) *Vector3D

func (*Vector3D) AddC

func (v *Vector3D) AddC(c float32) *Vector3D

func (*Vector3D) Clamp

func (v *Vector3D) Clamp(min, max Vector3D) *Vector3D

func (*Vector3D) Clone

func (v *Vector3D) Clone() *Vector3D

func (*Vector3D) CopyFrom

func (v *Vector3D) CopyFrom(start int, v1 Vector) *Vector3D

func (*Vector3D) CopyTo

func (v *Vector3D) CopyTo(start int, v1 Vector) Vector

func (*Vector3D) Cross

func (v *Vector3D) Cross(v1 Vector3D) *Vector3D

func (*Vector3D) Distance

func (v *Vector3D) Distance(v1 Vector3D) float32

func (*Vector3D) DistanceSqr

func (v *Vector3D) DistanceSqr(v1 Vector3D) float32

func (*Vector3D) DivC

func (v *Vector3D) DivC(c float32) *Vector3D

func (*Vector3D) DivCAdd

func (v *Vector3D) DivCAdd(c float32, v1 Vector3D) *Vector3D

func (*Vector3D) DivCSub

func (v *Vector3D) DivCSub(c float32, v1 Vector3D) *Vector3D

func (*Vector3D) Dot

func (v *Vector3D) Dot(v1 Vector3D) float32

func (*Vector3D) FillC

func (v *Vector3D) FillC(c float32) *Vector3D

func (*Vector3D) Interpolate

func (v *Vector3D) Interpolate(v1 Vector3D, t float32) *Vector3D

func (*Vector3D) Magnitude

func (v *Vector3D) Magnitude() float32

func (*Vector3D) MulC

func (v *Vector3D) MulC(c float32) *Vector3D

func (*Vector3D) MulCAdd

func (v *Vector3D) MulCAdd(c float32, v1 Vector3D) *Vector3D

func (*Vector3D) MulCSub

func (v *Vector3D) MulCSub(c float32, v1 Vector3D) *Vector3D

func (*Vector3D) Multiply

func (v *Vector3D) Multiply(v1 Vector3D) *Vector3D

func (*Vector3D) Neg

func (v *Vector3D) Neg() *Vector3D

func (*Vector3D) Normal

func (v *Vector3D) Normal() *Vector3D

func (*Vector3D) NormalFast

func (v *Vector3D) NormalFast() *Vector3D

func (*Vector3D) Reflect

func (v *Vector3D) Reflect(n Vector3D) *Vector3D

func (*Vector3D) Refract

func (v *Vector3D) Refract(n Vector3D, ni, nt float32) (*Vector3D, bool)

func (*Vector3D) Slice

func (v *Vector3D) Slice(start, end int) Vector

func (*Vector3D) Sub

func (v *Vector3D) Sub(v1 Vector3D) *Vector3D

func (*Vector3D) SubC

func (v *Vector3D) SubC(c float32) *Vector3D

func (*Vector3D) Sum

func (v *Vector3D) Sum() float32

func (*Vector3D) SumSqr

func (v *Vector3D) SumSqr() float32

func (*Vector3D) Vector

func (v *Vector3D) Vector() Vector

func (*Vector3D) XYZ

func (v *Vector3D) XYZ() (float32, float32, float32)

type Vector4D

type Vector4D [4]float32

func (*Vector4D) Add

func (v *Vector4D) Add(v1 Vector4D) *Vector4D

func (*Vector4D) AddC

func (v *Vector4D) AddC(c float32) *Vector4D

func (*Vector4D) Axis

func (v *Vector4D) Axis() Vector

func (*Vector4D) Clamp

func (v *Vector4D) Clamp(min, max Vector4D) *Vector4D

func (*Vector4D) Clone

func (v *Vector4D) Clone() *Vector4D

func (*Vector4D) Conjugate

func (v *Vector4D) Conjugate() *Vector4D

func (*Vector4D) CopyFrom

func (v *Vector4D) CopyFrom(start int, v1 Vector) *Vector4D

func (*Vector4D) CopyTo

func (v *Vector4D) CopyTo(start int, v1 Vector) Vector

func (*Vector4D) Distance

func (v *Vector4D) Distance(v1 Vector4D) float32

func (*Vector4D) DistanceSqr

func (v *Vector4D) DistanceSqr(v1 Vector4D) float32

func (*Vector4D) DivC

func (v *Vector4D) DivC(c float32) *Vector4D

func (*Vector4D) DivCAdd

func (v *Vector4D) DivCAdd(c float32, v1 Vector4D) *Vector4D

func (*Vector4D) DivCSub

func (v *Vector4D) DivCSub(c float32, v1 Vector4D) *Vector4D

func (*Vector4D) Dot

func (v *Vector4D) Dot(v1 Vector4D) float32

func (*Vector4D) FillC

func (v *Vector4D) FillC(c float32) *Vector4D

func (*Vector4D) Interpolate

func (v *Vector4D) Interpolate(v1 Vector4D, t float32) *Vector4D

func (*Vector4D) Magnitude

func (v *Vector4D) Magnitude() float32

func (*Vector4D) MulC

func (v *Vector4D) MulC(c float32) *Vector4D

func (*Vector4D) MulCAdd

func (v *Vector4D) MulCAdd(c float32, v1 Vector4D) *Vector4D

func (*Vector4D) MulCSub

func (v *Vector4D) MulCSub(c float32, v1 Vector4D) *Vector4D

func (*Vector4D) Multiply

func (v *Vector4D) Multiply(v1 Vector4D) *Vector4D

func (*Vector4D) Neg

func (v *Vector4D) Neg() *Vector4D

func (*Vector4D) Normal

func (v *Vector4D) Normal() *Vector4D

func (*Vector4D) NormalFast

func (v *Vector4D) NormalFast() *Vector4D

func (*Vector4D) Pitch

func (v *Vector4D) Pitch() float32

func (*Vector4D) Product

func (a *Vector4D) Product(b Quaternion) *Vector4D

func (*Vector4D) Reflect

func (v *Vector4D) Reflect(n Vector4D) *Vector4D

func (*Vector4D) Roll

func (v *Vector4D) Roll() float32

func (*Vector4D) Slerp

func (v *Vector4D) Slerp(v1 Vector4D, time, spin float32) *Vector4D

func (*Vector4D) SlerpLong

func (v *Vector4D) SlerpLong(v1 Vector4D, time, spin float32) *Vector4D

func (*Vector4D) Slice

func (v *Vector4D) Slice(start, end int) Vector

func (*Vector4D) Sub

func (v *Vector4D) Sub(v1 Vector4D) *Vector4D

func (*Vector4D) SubC

func (v *Vector4D) SubC(c float32) *Vector4D

func (*Vector4D) Sum

func (v *Vector4D) Sum() float32

func (*Vector4D) SumSqr

func (v *Vector4D) SumSqr() float32

func (*Vector4D) Theta

func (v *Vector4D) Theta() float32

func (*Vector4D) Vector

func (v *Vector4D) Vector() Vector

func (*Vector4D) XYZ

func (v *Vector4D) XYZ() (float32, float32, float32)

func (*Vector4D) XYZW

func (v *Vector4D) XYZW() (float32, float32, float32, float32)

func (*Vector4D) Yaw

func (v *Vector4D) Yaw() float32

Jump to

Keyboard shortcuts

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