vecutil

package
v0.0.0-...-ec9fd1c Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2012 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const NumAxes = 3

Variables

This section is empty.

Functions

func CreateCS

func CreateCS(normal vec64.Vector) (u, v vec64.Vector)

CreateCS finds two normalized vectors orthogonal to the given one that can be used as a coordinate system.

This is particularly useful for UV-mapping and the like.

func Float3

func Float3(v vec64.Vector) [3]float64

Float3 converts a vector into a float64 triple.

Types

type Axis

type Axis int

An Axis is one of the coordinate axes.

const (
	X Axis = iota
	Y
	Z
)

Axes

func LargestAxis

func LargestAxis(x, y, z float64) Axis

LargestAxis returns which parameter is the largest.

func (Axis) GoString

func (a Axis) GoString() string

func (Axis) Next

func (a Axis) Next() Axis

Next returns the next axis (and wraps after Z).

func (Axis) Prev

func (a Axis) Prev() Axis

Prev returns the previous axis (and wraps before X).

func (Axis) String

func (a Axis) String() string

Jump to

Keyboard shortcuts

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