rfa 0.5.9

A port ERFA to Rust.
Documentation
use super::{pm::*, sxp::*};
use super::super::{init::z::*};
///  Convert a p-vector into modulus and unit vector.
///
///  Given:
///     p        double[3]      p-vector
///
///  Returned:
///     r        double         modulus
///     u        double[3]      unit vector
///
///  Notes:
///
///  1) If p is null, the result is null.  Otherwise the result is a unit
///     vector.
///
///  2) It is permissible to re-use the same array for any of the
///     arguments.
///
///  Called:
///     eraPm        modulus of p-vector
///     eraZp        zero p-vector
///     eraSxp       multiply p-vector by scalar
///
///  This revision:  2021 May 11
pub fn pn(p: &[f64; 3], r: &mut f64, u:&mut [f64; 3])
{

 
 /* Obtain the modulus and test for zero. */
    let w = pm(p);
    if w == 0.0 {
 
    /* Null vector. */
       zp(u);
 
    } else {
 
    /* Unit vector. */
       sxp(1.0/w, p, u);
    }
 
 /* Return the modulus. */
    *r = w;
 
 /* Finished. */
 
 }