package
Version:
v0.8.14
Opens a new window with list of versions in this module.
Published: Dec 2, 2023
License: BSD-3-Clause
Opens a new window with license information.
Imports: 1
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.
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.
type Vec struct {
X, Y, Z float64
}
Vec is a 3D vector.
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.
Cross returns the cross product p×q.
Dot returns the dot product p·q.
Scale returns the vector p scaled by f.
Sub returns the vector sum of p and -q.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.