# Path: beyond/constants.py
# G = 6.6740831e-11
# class Body:
#     def __init__(self, name, mass, equatorial_radius, *, flattening=1, **kwargs):
#     def __repr__(self):
#     def __getattr__(self, name):
#     def mu(self):
#     def eccentricity(self):
#     def polar_radius(self):
#     def propagate(self, date):


import numpy as np
import logging
from ..constants import Earth
"""Utilities for Low Earth Orbit design
"""



log = logging.getLogger(__name__)


def sso(*, a=None, e=None, i=None):
    """Compute keplerian elements for a Sun-Synchronous Orbit

    Given two elements among a, e and i, compute the remaining one.

    Example:
        .. code-block:: python

            e = sso(a=a, i=i)
            i = sso(a=a, e=e)
            a = sso(e=e, i=i)

    Args:
        a (float) : Semi major axis, in meters
        e (float) : Eccentricity
        i (float) : Inclination in radians
    """

    ω_e = 2 * np.pi / 365.256363004 / 86400

# Path: beyond/constants.py
# G = 6.6740831e-11
# class Body:
#     def __init__(self, name, mass, equatorial_radius, *, flattening=1, **kwargs):
#     def __repr__(self):
#     def __getattr__(self, name):
#     def mu(self):
#     def eccentricity(self):
#     def polar_radius(self):
#     def propagate(self, date):


# Path: beyond/utils/leo.py
import numpy as np
import logging
from ..constants import Earth

"""Utilities for Low Earth Orbit design
"""



log = logging.getLogger(__name__)


def sso(*, a=None, e=None, i=None):
    """Compute keplerian elements for a Sun-Synchronous Orbit

    Given two elements among a, e and i, compute the remaining one.

    Example:
        .. code-block:: python

            e = sso(a=a, i=i)
            i = sso(a=a, e=e)
            a = sso(e=e, i=i)

    Args:
        a (float) : Semi major axis, in meters
        e (float) : Eccentricity
        i (float) : Inclination in radians
    """

    ω_e = 2 * np.pi / 365.256363004 / 86400

    cst = np.sqrt(Earth.mu) * Earth.r ** 2 * Earth.J2