transverse_values

Function transverse_values 

Source
pub(crate) fn transverse_values(
    vector: [Complex; 2],
) -> Result<(Complex, [Complex; 2])>
Expand description

The transverse norm sqrt(kx^2 + ky^2) (principal root) and the unit transverse direction (kx, ky) / norm, which is (cos phi, sin phi) for a real wavevector.

Gives zeros for kx = ky = 0, and an error when a complex (kx, ky) is nonzero but has a zero algebraic norm, where the direction is undefined.