tfg.math.math_helpers.cartesian_to_spherical_coordinates

Function to transform Cartesian coordinates to spherical coordinates.

tfg.math.math_helpers.cartesian_to_spherical_coordinates(
    point_cartesian,
    name=None
)

Defined in math/math_helpers.py.

Note:

In the following, A1 to An are optional batch dimensions.

Args:

  • point_cartesian: A tensor of shape [A1, ..., An, 3]. In the last dimension, the data follows the x,y,z order.
  • name: A name for this op. Defaults to 'cartesian_to_spherical_coordinates'.

Returns:

A tensor of shape [A1, ..., An, 3]. The last dimensions contains (r,theta,phi), where r is the sphere radius, theta the polar angle and phi the azimuthal angle.