Coordinates

This page provides a detailed description of the coordinates functions implemented in the HAOT package. For additional clarity, these descriptions can also be accessed and explored interactively in a Python session using the help() function.

haot.haversine_distance(latitude_1, longitude_1, latitude_2, longitude_2, sphere_radius=6371000.0)[source]

Calculates the Haversine distance between two points

Parameters:
  • latitude_1 (float) – latitude of point 1 in [degs]

  • longitude_1 (float) – longitude of point 1 in [degs]

  • latitude_2 (float) – latitude of point 2 in [degs]

  • longitude_2 (float) – longitude of point 2 in [degs]

  • sphere_radius (float) – sphere radius, 6371E3 (default, earth radius in [m])

Return type:

float

Returns:

Haversine distance in units of sphere radius

haot.lla_to_ecef(*args)[source]

Converts LLA position to ECEF position

Parameters:

*args

Either of the following forms:
  1. lat_deg, lon_deg, alt_m : float Latitude [degrees], longitude [degrees], and altitude [m].

  2. [lat_deg, lon_deg, alt_m] : array_like Iterable (list, tuple, or NumPy array) containing latitude [degrees], longitude [degrees], and altitude [m].

Returns:

float ECEF coordinates [m]

Return type:

ecef_x, ecef_y, ecef_z

haot.ecef_to_lla(*args)[source]

Converts ECEF position to LLA position

Source: https://danceswithcode.net/engineeringnotes/geodetic_to_ecef/geodetic_to_ecef.html

Parameters:

*args

Either of the following forms:
  1. ecef_x, ecef_y, ecef_zfloat

    ECEF Cartesian coordinates [m].

  2. [ecef_x, ecef_y, ecef_z] : array_like Iterable (list, tuple, or NumPy array) containing ECEF coordinates [x, y, z] in meters.

Returns:

numpy.ndarray of shape (3,)

Geodetic coordinates [latitude (deg), longitude (deg), altitude (m)].

Return type:

lla

haot.roll_dcm(roll_deg)[source]

Creates a roll DCM

Parameters:

roll_deg (float) – roll angle in [degs]

Return type:

ndarray

Returns: roll DCM

haot.pitch_dcm(pitch_deg)[source]

Creates a pitch DCM

Parameters:

pitch_deg (float) – pitch angle in [degs]

Return type:

ndarray

Returns: pitch DCM

haot.yaw_dcm(yaw_deg)[source]

Creates a yaw DCM

Parameters:

yaw_deg (float) – yaw angle in [degs]

Return type:

ndarray

Returns: yaw DCM

haot.euler_321_dcm(*args)[source]
Parameters:

*args

Either of the following forms:
  1. roll_deg, pitch_deg, yaw_deg : float

  2. [roll_deg, pitch_deg, yaw_deg] : array_like

Return type:

ndarray

Returns:

standard 321 (Yaw->Pitch->Roll) DCM ecef_x, ecef_y, ecef_z: float ECEF coordinates [m]

haot.euler_angles_from_dcm(dcm)[source]
Parameters:

dcm (ndarray) – directional cosine matrix

Return type:

ndarray

Returns:

euler angles, [roll_deg, pitch_deg, yaw_deg] in [degrees]