space

package
v0.0.0-...-6db7017 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2020 License: AGPL-3.0 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 [][]float64

Matrix is a transformational matrix for 3D space (3 x 3)

func NewRotationMatrixX

func NewRotationMatrixX(theta float64) Matrix

NewRotationMatrixX produces a matrix which will rotate about X

func NewRotationMatrixY

func NewRotationMatrixY(theta float64) Matrix

NewRotationMatrixY produces a matrix which will rotate about X

func NewRotationMatrixZ

func NewRotationMatrixZ(theta float64) Matrix

NewRotationMatrixZ produces a matrix which will rotate about X

func (Matrix) Mult

func (m Matrix) Mult(n Matrix) Matrix

Mult will return the result of m * n

type Vector

type Vector struct {
	X, Y, Z float64
}

Vector is a 3D coordinate (also known as Point)

func NewVector

func NewVector(theta, phi, radius float64) Vector

NewVector produces a new Vector from spherical coordinates

func (Vector) Scale

func (v Vector) Scale(i float64) Vector

Scale multivlies a vector by a given scale

func (Vector) Transform

func (v Vector) Transform(m Matrix) Vector

func (Vector) Translate

func (v Vector) Translate(q Vector) Vector

Translate shifts a vector by another vector (addition)

Jump to

Keyboard shortcuts

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