package
Version:
v0.8.1-0...-a25970e
Opens a new window with list of versions in this module.
Published: Mar 17, 2021
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package r3 provides 3D vectors and boxes and operations on them.
Cos returns the cosine of the opening angle between p and q.
Dot returns the dot product p·q.
Norm returns the Euclidean norm of p
|p| = sqrt(p_x^2 + p_y^2 + p_z^2).
Norm returns the Euclidean squared norm of p
|p|^2 = p_x^2 + p_y^2 + p_z^2.
type Box struct {
Min, Max Vec
}
Box is a 3D bounding box.
Rotation describes a rotation in space.
NewRotation creates a rotation by alpha, around axis.
Rotate returns the rotated vector according to the definition of rot.
type Vec struct {
X, Y, Z float64
}
Vec is a 3D vector.
Add returns the vector sum of p and q.
Cross returns the cross product p×q.
Rotate returns a new vector, rotated by alpha around the provided axis.
Scale returns the vector p scaled by f.
Sub returns the vector sum of p and -q.
Unit returns the unit vector colinear to p.
Unit returns {NaN,NaN,NaN} for the zero vector.
Add returns the vector sum of p and q.
DEPRECATED: use r3.Add.
Cross returns the cross product p×q.
DEPRECATED: use r3.Cross.
Dot returns the dot product p·q.
DEPRECATED: use r3.Dot.
Rotate returns a new vector, rotated by alpha around the provided axis.
DEPRECATED: use r3.Rotate
Scale returns the vector p scaled by f.
DEPRECATED: use r3.Scale.
Sub returns the vector sum of p and -q.
DEPRECATED: use r3.Sub.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.