poliastro2.math.util

Functions

alinspace(start[, stop, num, endpoint])

Return increasing, evenly spaced angular values over a specified interval.

planetocentric_to_AltAz(theta, phi)

Defines transformation matrix to convert from Planetocentric coordinate system to the Altitude-Azimuth system.

rotation_matrix(angle, axis)

spherical_to_cartesian(v)

Compute cartesian coordinates from spherical coordinates (norm, colat, long).

poliastro2.math.util.alinspace(start, stop=None, num=50, endpoint=True)

Return increasing, evenly spaced angular values over a specified interval.

poliastro2.math.util.planetocentric_to_AltAz(theta, phi)

Defines transformation matrix to convert from Planetocentric coordinate system to the Altitude-Azimuth system.

\[\begin{split}t\_matrix = \begin{bmatrix} -\sin(theta) & \cos(theta) & 0\\ -\sin(phi)\cdot\cos(theta) & -\sin(phi)\cdot\sin(theta) & \cos(phi)\\ \cos(phi)\cdot\cos(theta) & \cos(phi)\cdot\sin(theta) & \sin(phi) \end{bmatrix}\end{split}\]
Parameters:
  • theta (float) – Local sidereal time

  • phi (float) – Planetodetic latitude

Returns:

t_matrix – Transformation matrix

Return type:

numpy.ndarray

poliastro2.math.util.rotation_matrix(angle, axis)
poliastro2.math.util.spherical_to_cartesian(v)

Compute cartesian coordinates from spherical coordinates (norm, colat, long). This function is vectorized.

\[\begin{split}v = norm \cdot \begin{bmatrix} \sin(colat)\cos(long)\\ \sin(colat)\sin(long)\\ \cos(colat)\\ \end{bmatrix}\end{split}\]
Parameters:

v (numpy.ndarray) – Spherical coordinates in 3D (norm, colat, long). Angles must be in radians.

Returns:

v – Cartesian coordinates (x,y,z)

Return type:

numpy.ndarray