mathutils

package
Version: v0.0.0-...-427eadb Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: AGPL-3.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeightOnTriangle

func HeightOnTriangle(p Vector3D, t *[3]Vector3D) float64

HeightOnTriangle calculate height of point on a triangle

func HighestInTriangle

func HighestInTriangle(triangle *[3]Vector3D) (h float64)

HighestInTriangle Find the height of the heighest point in triangle

Types

type Matrix3

type Matrix3 struct {
	// contains filtered or unexported fields
}

Matrix3 is a 3x3 matrix

func MakeMatrix3X

func MakeMatrix3X(angle float64) (mat Matrix3)

MakeMatrix3X generate the X component of a rotation matrix

func MakeMatrix3Y

func MakeMatrix3Y(angle float64) (mat Matrix3)

MakeMatrix3Y generate the Y component of a rotation matrix

func MakeMatrix3Z

func MakeMatrix3Z(angle float64) (mat Matrix3)

MakeMatrix3Z generate the Z component of a rotation matrix

func NewMatrix3

func NewMatrix3() Matrix3

NewMatrix3 create a new Matrix3

func (*Matrix3) Inverse

func (m *Matrix3) Inverse(n *Matrix3)

Inverse put the inverse of m into n

func (*Matrix3) Mul

func (m *Matrix3) Mul(m2 Matrix3) (r Matrix3)

Mul multiplies a Matrix3 by m2 (also a Matrix3)

func (*Matrix3) ToEulerAngle

func (m *Matrix3) ToEulerAngle() (v Vector3D)

ToEulerAngle convert a Matrix3 to Euler's angles

func (*Matrix3) ToQuaternion

func (m *Matrix3) ToQuaternion() (q Quaternion)

ToQuaternion convert a rotation matrix3 to quaternion

type Quaternion

type Quaternion struct {
	W float64
	X float64
	Y float64
	Z float64
}

Quaternion ...

func (*Quaternion) Mul

func (q *Quaternion) Mul(r *Quaternion) (s *Quaternion)

Mul multiplies 2 quaternions

type Vector3D

type Vector3D struct {
	X float64 `json:"x"`
	Y float64 `json:"y"`
	Z float64 `json:"z"`
}

Vector3D ...

func CrossProduct

func CrossProduct(u *Vector3D, v *Vector3D) (d Vector3D)

CrossProduct returns the cross product of u and v

func (*Vector3D) Add

func (v *Vector3D) Add(b Vector3D) (c Vector3D)

Add adds two vectors together

func (*Vector3D) DivScalar

func (v *Vector3D) DivScalar(x float64) (c Vector3D)

DivScalar divide the vector by a sigle number

func (*Vector3D) MulScalar

func (v *Vector3D) MulScalar(x float64) (c Vector3D)

MulScalar scale the vector by a sigle number

func (*Vector3D) MultiplyByMatrix3

func (v *Vector3D) MultiplyByMatrix3(m *Matrix3) (p Vector3D)

MultiplyByMatrix3 multiply a Vector3D by a Matrix3

func (*Vector3D) Sub

func (v *Vector3D) Sub(b Vector3D) (c Vector3D)

Sub substract 2 vectors

Jump to

Keyboard shortcuts

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