Skip to content

redplanet.helper_functions.geodesy.make_circle

make_circle(
    lon: float,
    lat: float,
    radius: float,
    n_samples: int = 180,
    endpoint: bool = False,
) -> ndarray

Generate a geodesic circle of points on the surface of Mars.

Parameters:

Name Type Description Default
lon float

Longitude coordinate of the center of the circle, in range [-180, 360].

required
lat float

Latitude coordinate of the center of the circle, in range [-90, 90].

required
radius float

Radius of the circle in meters.

required
endpoint bool

If True, include the starting point at the end of the circle. Default is False.

False

Returns:

Type Description
np.ndarray

Array of shape (n_samples, 2) [? verify this] containing the longitude and latitude coordinates of the circle points.

See Also

For more details about the reference ellipsoid, see redplanet.helper_functions.geodesy.get_distance.

Source code in src/redplanet/helper_functions/geodesy.py
def make_circle(
    lon       : float,
    lat       : float,
    radius    : float,  ## TODO: should this be suffixed with '_m' or '_km' to indicate units...?
    n_samples : int  = 180,
    endpoint  : bool = False,
) -> np.ndarray:
    """
    Generate a geodesic circle of points on the surface of Mars.

    Parameters
    ----------
    lon : float
        Longitude coordinate of the center of the circle, in range [-180, 360].
    lat : float
        Latitude coordinate of the center of the circle, in range [-90, 90].
    radius : float
        Radius of the circle in meters.
    endpoint : bool, optional
        If True, include the starting point at the end of the circle. Default is False.

    Returns
    -------
    np.ndarray
        Array of shape (n_samples, 2) [? verify this] containing the longitude and latitude coordinates of the circle points.

    See Also
    --------
    For more details about the reference ellipsoid, see `redplanet.helper_functions.geodesy.get_distance`.
    """
    geodesic = __get_mars_geodesic()
    return geodesic.circle(lon, lat, radius, n_samples, endpoint)