Documentation
¶
Index ¶
- Variables
- func MinMax(pts ...Pt) (Pt, Pt)
- type D3
- type Point
- type Pt
- func (pt Pt) Add(v V) Pt
- func (pt Pt) AssertEqual(actual interface{}, t cmpr.Tolerance) error
- func (pt Pt) Distance(pt2 Pt) float64
- func (pt Pt) Mag() float64
- func (pt Pt) Mag2() float64
- func (pt Pt) Multiply(scale float64) Pt
- func (pt Pt) Pt() Pt
- func (pt Pt) Round() Pt
- func (pt Pt) String() string
- func (pt Pt) Subtract(pt2 Pt) V
- type Pt1
- type Pt2
- type Pt2c1
- type Q
- type Rotation
- type RotationPlane
- type Scale
- type T
- func (t *T) AssertEqual(to interface{}, tol cmpr.Tolerance) error
- func (t *T) Inversion() (*T, bool)
- func (t *T) Pt(pt Pt) Pt
- func (t *T) PtF(pt Pt) (Pt, float64)
- func (t *T) PtScl(pt Pt) Pt
- func (t *T) Pts(pts []Pt) []Pt
- func (t *T) PtsScl(pts []Pt) []Pt
- func (t T) String() string
- func (t *T) T(t2 *T) *T
- func (t *T) TInv() *T
- func (t *T) V(v V) V
- func (t *T) VF(v V) (V, float64)
- type TGen
- type TGenInv
- type TGenPair
- type TransformSet
- type Translate
- type V
- func (v V) Abs() V
- func (v V) Add(v2 V) V
- func (v V) Ang(v2 V) angle.Rad
- func (v V) AssertEqual(actual interface{}, t cmpr.Tolerance) error
- func (v V) Cross(v2 V) V
- func (v V) Dot(v2 V) float64
- func (v V) Mag() float64
- func (v V) Mag2() float64
- func (v V) Multiply(scale float64) V
- func (v V) Normal() V
- func (v V) Project(v2 V) V
- func (v V) String() string
- func (v V) Subtract(v2 V) V
- func (v V) V() V
- type V1
- type Vector
Constants ¶
This section is empty.
Variables ¶
var Prec = 4
Prec is the precision for the String method on F
Functions ¶
Types ¶
type D3 ¶
type D3 struct {
X, Y, Z float64
}
D3 is an abstract two dimensional struct holding the methods shared by both Pt and V.
type Pt ¶
type Pt D3
Pt represets a three dimensional point.
func (Pt) AssertEqual ¶
AssertEqual fulfils geomtest.AssertEqualizer
func (Pt) Mag2 ¶
Mag2 returns the square of the magnitude. For comparisions this can be more efficient as it avoids a sqrt call.
type Q ¶
type Q struct {
A, B, C, D float64
}
Q is a quaternion used for rotations. B, C and D correspond to the X, Y and Z axis.
func QV ¶
QV produces an instance of Q such that Q applied to V{1,0,0} will point in the same direction as the argument v.
type Rotation ¶
type Rotation struct { Angle angle.Rad Plane RotationPlane }
Rotation fulfill TGen
type RotationPlane ¶
type RotationPlane byte
RotationPlane represents the planes for rotation.
const ( XY RotationPlane = iota XZ YZ )
The 3 planes for rotation
type Scale ¶
type Scale V
Scale fulfills TGen and produces a T that scales by V.
type T ¶
type T [4][4]float64
T is a 3D transform.
func (*T) AssertEqual ¶
AssertEqual fulfils geomtest.AssertEqualizer
func (*T) Inversion ¶
Inversion returns the inverse of T and a bool indicating if the inversion is valid.
type TGenPair ¶
TGenPair provides a way to get both the Transform and it's Inverse at the same time which can sometimes be more efficient.
type TransformSet ¶
type TransformSet struct {
Head, Middle, Tail []*T
}
TransformSet builds up a chain of transformaitions.
func (*TransformSet) AddBoth ¶
func (ts *TransformSet) AddBoth(t [2]*T) *TransformSet
AddBoth appends the transform and it's inverse to the head and tail.
func (*TransformSet) Get ¶
func (ts *TransformSet) Get() *T
Get produces a transform produces a transform by applying the transforms in head, then middle then applying tail in reverse.
type Translate ¶
type Translate V
Translate fulfills TGen that translates by V
type V ¶
type V D3
V is a 3D vector.
func (V) AssertEqual ¶
AssertEqual fulfils geomtest.AssertEqualizer
Directories
¶
Path | Synopsis |
---|---|
Package affine allows for combinations of points where the sum of the coefficients is zero.
|
Package affine allows for combinations of points where the sum of the coefficients is zero. |
curve
|
|
render
|
|
shape
|
|
box
Package box provids a 3D bounding box.
|
Package box provids a 3D bounding box. |