pub fn spherical2cartesian(sphere_vec: &Vector3<f64>) -> Vector3<f64>
Expand description

Converts 3-d spherical coordinates to 3-d cartesian coordinates

Arguments

  • sphere_vec - Vector3 reference to the spherical vector (rho, theta, phi) (r, el, az) in radians

Return Value

  • nalgebra::Vector3<f64> - x, y, z

Formula

  • x = rho * sin(theta) * cos(phi)
  • y = rho * sin(theta) * sin(phi)
  • z = rho * cos(theta)