tfg.math.math_helpers.cartesian_to_spherical_coordinates

View source on GitHub

Function to transform Cartesian coordinates to spherical coordinates.

Note:

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

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'.

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.