geometry

package
v0.0.0-...-894aba7 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 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 Vector3

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

Vector3 represents a 3 element vector

func NewVector

func NewVector(e0, e1, e2 float64) Vector3

NewVector creates a new Vector3 object

func (Vector3) Add

func (v Vector3) Add(vec2 Vector3) Vector3

Add returns the sum of two vectors

func (Vector3) CrossProduct

func (v Vector3) CrossProduct(vec2 Vector3) Vector3

CrossProduct returns the cross product (vector product) of two vectors

func (Vector3) Divide

func (v Vector3) Divide(vec2 Vector3) Vector3

Divide returns the result of dividing current vector by another vector

func (Vector3) DotProduct

func (v Vector3) DotProduct(vec2 Vector3) float64

DotProduct returns the dot product (scalar product) of two vectors

func (Vector3) Inverse

func (v Vector3) Inverse() Vector3

Inverse returns new vector with all the elements of the current vector inversed

func (Vector3) Length

func (v Vector3) Length() float64

Length returns current vector's length

func (Vector3) LengthSquared

func (v Vector3) LengthSquared() float64

LengthSquared returns sum of all the elements squared

func (Vector3) ScalarMultiply

func (v Vector3) ScalarMultiply(scalar float64) Vector3

ScalarMultiply returns the result of multiplying current vector by a scalar (scalar multiplication)

func (Vector3) Subtract

func (v Vector3) Subtract(vec2 Vector3) Vector3

Subtract returns the difference (subtracting result) between two vectors

func (Vector3) VectorMultiply

func (v Vector3) VectorMultiply(vec2 Vector3) Vector3

VectorMultiply returns the result of multiplying current vector by another vector

func (Vector3) X

func (v Vector3) X() float64

X Returns the first element of the current vector

func (Vector3) Y

func (v Vector3) Y() float64

Y Returns the second element of the current vector

func (Vector3) Z

func (v Vector3) Z() float64

Z Returns the third element of the current vector

Jump to

Keyboard shortcuts

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