Skip to main content

normalise

Function normalise 

Source
pub fn normalise<T>(a: &Vector3<T>, min_sq_value: T) -> Option<Vector3<T>>
where T: Float + Scalar + ComplexField<RealField = T>,
Expand description

Normalize a vector to lie on the surface of the unit sphere.

Note: this function returns an Option so uses the British spelling of normalise to differentiate it from the standard normalize function.

  • a the Vector3
  • min_sq_value the minimum square of a vector length to normalize.

return the nomalized point or None if the vector is too small to normalize.