Expand description
3-vectors over [f64; 3]. Every function is FMA-free with the op order
written out; see the module conventions.
Functions§
- add
- canonical
- Flip
nso its largest-magnitude component is positive, so a face and its antipodal opposite collapse onto one direction. Ties break x, y, z. A NaN component never wins a comparison, and-0.0 < 0.0is false, so neither flips the vector. - cross
- Right-handed cross product, each component
x*y - z*wunfused. - dist
- Distance,
norm(sub(a, b)). Bit-equal to thepowi(2)spelling:powi(x, 2)lowers tox * x. - dot
a0*b0 + a1*b1 + a2*b2, left to right, never fused.- norm
- Euclidean length,
dot(a, a).sqrt(). (Nothypot: the two differ in the last bit, and every site on main uses this spelling.) - normalize
v / |v|, orNonewhen the length is not finite or is<= min_len.- scale
- sub
- tri_
normal - The unnormalised triangle normal
cross(b - a, c - a); its length is twice the triangle’s area.
Type Aliases§
- V3
- A 3-vector.