vector

package
v0.0.0-...-750c5a3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix struct {
	M00, M01, M02, M03 float64
	M10, M11, M12, M13 float64
	M20, M21, M22, M23 float64
	M30, M31, M32, M33 float64
}

func Frustum

func Frustum(left, right, bottom, top, near, far float64) Matrix

func Identity

func Identity() Matrix

func LookAt

func LookAt(from, to, up Vector) Matrix

func Orthographic

func Orthographic(left, right, bottom, top, near, far float64) Matrix

func Perspective

func Perspective(fovy, aspect, near, far float64) Matrix

func RotateAxis

func RotateAxis(axis Vector, angle float64) Matrix

func RotateX

func RotateX(angle float64) Matrix

func RotateY

func RotateY(angle float64) Matrix

func RotateZ

func RotateZ(angle float64) Matrix

func Scale

func Scale(v Vector) Matrix

func Translate

func Translate(v Vector) Matrix

func (Matrix) Add

func (m1 Matrix) Add(m2 Matrix) Matrix

func (Matrix) Mul

func (m1 Matrix) Mul(m2 Matrix) Matrix

func (Matrix) MulScalar

func (m1 Matrix) MulScalar(f float64) Matrix

func (Matrix) MulVector

func (m1 Matrix) MulVector(v Vector) Vector

func (Matrix) Sub

func (m1 Matrix) Sub(m2 Matrix) Matrix

type Vector

type Vector struct {
	X, Y, Z float64
}

func NewVector

func NewVector(x, y, z float64) Vector

func Unit

func Unit() Vector

func UnitX

func UnitX() Vector

func UnitY

func UnitY() Vector

func UnitZ

func UnitZ() Vector

func Zero

func Zero() Vector

func (Vector) Add

func (v1 Vector) Add(v2 Vector) Vector

func (Vector) AddScalar

func (v1 Vector) AddScalar(f float64) Vector

func (Vector) Cross

func (v1 Vector) Cross(v2 Vector) Vector

func (Vector) Div

func (v1 Vector) Div(v2 Vector) Vector

func (Vector) DivScalar

func (v1 Vector) DivScalar(f float64) Vector

func (Vector) Dot

func (v1 Vector) Dot(v2 Vector) float64

func (Vector) Length

func (v1 Vector) Length() float64

func (Vector) LengthSq

func (v1 Vector) LengthSq() float64

func (Vector) Mul

func (v1 Vector) Mul(v2 Vector) Vector

func (Vector) MulScalar

func (v1 Vector) MulScalar(f float64) Vector

func (Vector) Negate

func (v1 Vector) Negate() Vector

func (Vector) Normalize

func (v1 Vector) Normalize() Vector

func (Vector) Sub

func (v1 Vector) Sub(v2 Vector) Vector

func (Vector) SubScalar

func (v1 Vector) SubScalar(f float64) Vector

Jump to

Keyboard shortcuts

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