Function tool::core::geometry::cart_to_sph[][src]

pub fn cart_to_sph<T, S>(vectors: &VectorsGeneric<T, S>) -> Vectors<T> where
    T: RealField + NumCast,
    S: Storage<T, U3, Dynamic>, 
Expand description

Convert a list of Vectors from cartesian to spherical coordinates.

Expression

$$\theta={\rm arctan2}\left(q_y, q_x\right)$$ $$\phi=\arcsin\left(\frac{q_z}{\left\Vert\bm{q}\right\Vert}\right)$$ $$\rho=\left\Vert\bm{q}\right\Vert$$

where $\theta$ is the azimuth, $\phi$ is the elevation, $\rho$ the radius, and $\bm{q}$ the cartesian vector.