Skip to main content

Module vector

Module vector 

Source
Expand description

Three-component vectors in f64, as plain arrays: the one set of the arithmetic every crate’s geometry in f64 shares (f32 meshes have primase_meshops::Vec3). Each operation is one fixed order of operations, so any two crates computing the same thing get the same bits.

Functions§

add
cross
dot
a0 b0 + a1 b1 + a2 b2, summed in that order.
length
The Euclidean length, sqrt(a . a).
scale
a times s.
sub
unit
a divided by its length; None where the length is 0 or not finite (a vector with no direction), for the caller to say what that means where it can happen.
unit_beyond
a divided by its length where that is above shortest (the caller’s: below it a direction is noise), else None.

Type Aliases§

V3
A vector or point, x, y, z.