TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfg.math.math_helpers.spherical_to_cartesian_coordinates

Function to transform Cartesian coordinates to spherical coordinates.

tfg.math.math_helpers.spherical_to_cartesian_coordinates(
    point_spherical,
    name=None
)

Defined in math/math_helpers.py.

Note:

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

Args:

  • point_spherical: A tensor of shape [A1, ..., An, 3]. The last dimension contains r, theta, and phi that respectively correspond to the radius, polar angle and azimuthal angle; r must be non-negative.
  • name: A name for this op. Defaults to 'spherical_to_cartesian_coordinates'.

Raises:

  • tf.errors.InvalidArgumentError: If r, theta or phi contains out of range data.

Returns:

A tensor of shape [A1, ..., An, 3], where the last dimension contains the cartesian coordinates in x,y,z order.