tfep.utils.geometry.polar_to_cartesian

tfep.utils.geometry.polar_to_cartesian(r: Tensor, angle: Tensor, return_log_det_J: bool = False) Tuple[Tensor][source]

Transform polar coordinates into Cartesian.

Parameters:
  • r (torch.Tensor) – Shape (batch_size,). The radius coordinate.

  • angle (torch.Tensor) – Shape (batch_size,). The angle coordinate in radians.

  • return_log_det_J (bool, optional) – If True, the absolute value of the Jacobian determinant of the transformation is also returned.

Returns:

  • x (torch.Tensor) – Shape (batch_size,). The x Cartesian coordinate.

  • y (torch.Tensor) – Shape (batch_size,). The y Cartesian coordinate.

  • log_det_J (torch.Tensor, optional) – The absolute value of the Jacobian determinant of the transformation.