# 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/matrix.py
# def rot2(theta):
#     """
#     Args:
#         theta (float): Angle in radians
#     Return:
#         Rotation matrix of angle theta around the Y-axis
#     """
#     return np.array(
#         [
#             [np.cos(theta), 0, -np.sin(theta)],
#             [0, 1, 0],
#             [np.sin(theta), 0, np.cos(theta)],
#         ]
#     )
# 
# def rot3(theta):
#     """
#     Args:
#         theta (float): Angle in radians
#     Return:
#         Rotation matrix of angle theta around the Z-axis
#     """
#     return np.array(
#         [
#             [np.cos(theta), np.sin(theta), 0],
#             [-np.sin(theta), np.cos(theta), 0],
#             [0, 0, 1],
#         ]
#     )
# 
# def expand(m, rate=None):
#     """Transform a 3x3 rotation matrix into a 6x6 rotation matrix
# 
#     Args:
#         m (numpy.ndarray) : 3x3 matrix transforming a position vector
#             from frame1 to frame2
#         rate (numpy.array) : 1D 3 elements vector rate of frame2
#             expressed in frame1
#     Return:
#         numpy.ndarray : 6x6 rotation matrix
# 
#     Example:
# 
#     >>> m = np.array([[0, -1, 0], [-1, 0, 0], [0, 0, 1]])
#     >>> print(expand(m))
#     [[ 0. -1.  0.  0.  0.  0.]
#      [-1.  0.  0.  0.  0.  0.]
#      [ 0.  0.  1.  0.  0.  0.]
#      [ 0.  0.  0.  0. -1.  0.]
#      [ 0.  0.  0. -1.  0.  0.]
#      [ 0.  0.  0.  0.  0.  1.]]
#     >>> print(expand(m, rate=[1,2,3]))
#     [[ 0. -1.  0.  0.  0.  0.]
#      [-1.  0.  0.  0.  0.  0.]
#      [ 0.  0.  1.  0.  0.  0.]
#      [-3.  0. -2.  0. -1.  0.]
#      [ 0.  3.  1. -1.  0.  0.]
#      [ 1. -2.  0.  0.  0.  1.]]
#     """
# 
#     out = np.zeros((6, 6))
#     out[:3, :3] = m
#     out[3:, 3:] = m
# 
#     if rate is not None:
#         R = np.array(
#             [[0, -rate[2], rate[1]], [rate[2], 0, -rate[0]], [-rate[1], rate[0], 0]]
#         )
#         out[3:, :3] = -R @ m
# 
#     return out


import numpy as np
from . import frames, center, orient
from ..constants import Earth
from ..utils.matrix import rot2, rot3, expand
        from ..propagators.listeners import stations_listeners, Listener
            # Only the events present in the `event_classes` list will be yielded
            # outside of visibility. This list was created in order to force
            # the yield of AOS and LOS.

            event_classes = tuple(listener.event for listener in sta_list)

        for point in orb.iter(**kwargs):
            point.frame = self
            point.form = "spherical"

            # Not very clean !
            if point.phi < 0 and not isinstance(point.event, event_classes):
                continue

            yield point

    @classmethod
    def _geodetic_to_cartesian(cls, lat, lon, alt):
        """Conversion from latitude, longitude and altitude coordinates to
        cartesian with respect to an ellipsoid

        Args:
            lat (float): Latitude in radians
            lon (float): Longitude in radians
            alt (float): Altitude to sea level in meters

        Return:
            numpy.array: 3D element (in meters)
        """
        C = Earth.r / np.sqrt(1 - (Earth.e * np.sin(lat)) ** 2)

# 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/matrix.py
# def rot2(theta):
#     """
#     Args:
#         theta (float): Angle in radians
#     Return:
#         Rotation matrix of angle theta around the Y-axis
#     """
#     return np.array(
#         [
#             [np.cos(theta), 0, -np.sin(theta)],
#             [0, 1, 0],
#             [np.sin(theta), 0, np.cos(theta)],
#         ]
#     )
# 
# def rot3(theta):
#     """
#     Args:
#         theta (float): Angle in radians
#     Return:
#         Rotation matrix of angle theta around the Z-axis
#     """
#     return np.array(
#         [
#             [np.cos(theta), np.sin(theta), 0],
#             [-np.sin(theta), np.cos(theta), 0],
#             [0, 0, 1],
#         ]
#     )
# 
# def expand(m, rate=None):
#     """Transform a 3x3 rotation matrix into a 6x6 rotation matrix
# 
#     Args:
#         m (numpy.ndarray) : 3x3 matrix transforming a position vector
#             from frame1 to frame2
#         rate (numpy.array) : 1D 3 elements vector rate of frame2
#             expressed in frame1
#     Return:
#         numpy.ndarray : 6x6 rotation matrix
# 
#     Example:
# 
#     >>> m = np.array([[0, -1, 0], [-1, 0, 0], [0, 0, 1]])
#     >>> print(expand(m))
#     [[ 0. -1.  0.  0.  0.  0.]
#      [-1.  0.  0.  0.  0.  0.]
#      [ 0.  0.  1.  0.  0.  0.]
#      [ 0.  0.  0.  0. -1.  0.]
#      [ 0.  0.  0. -1.  0.  0.]
#      [ 0.  0.  0.  0.  0.  1.]]
#     >>> print(expand(m, rate=[1,2,3]))
#     [[ 0. -1.  0.  0.  0.  0.]
#      [-1.  0.  0.  0.  0.  0.]
#      [ 0.  0.  1.  0.  0.  0.]
#      [-3.  0. -2.  0. -1.  0.]
#      [ 0.  3.  1. -1.  0.  0.]
#      [ 1. -2.  0.  0.  0.  1.]]
#     """
# 
#     out = np.zeros((6, 6))
#     out[:3, :3] = m
#     out[3:, 3:] = m
# 
#     if rate is not None:
#         R = np.array(
#             [[0, -rate[2], rate[1]], [rate[2], 0, -rate[0]], [-rate[1], rate[0], 0]]
#         )
#         out[3:, :3] = -R @ m
# 
#     return out


# Path: beyond/frames/stations.py
import numpy as np
from . import frames, center, orient
from ..constants import Earth
from ..utils.matrix import rot2, rot3, expand
        from ..propagators.listeners import stations_listeners, Listener

            # Only the events present in the `event_classes` list will be yielded
            # outside of visibility. This list was created in order to force
            # the yield of AOS and LOS.

            event_classes = tuple(listener.event for listener in sta_list)

        for point in orb.iter(**kwargs):
            point.frame = self
            point.form = "spherical"

            # Not very clean !
            if point.phi < 0 and not isinstance(point.event, event_classes):
                continue

            yield point

    @classmethod
    def _geodetic_to_cartesian(cls, lat, lon, alt):
        """Conversion from latitude, longitude and altitude coordinates to
        cartesian with respect to an ellipsoid

        Args:
            lat (float): Latitude in radians
            lon (float): Longitude in radians
            alt (float): Altitude to sea level in meters

        Return:
            numpy.array: 3D element (in meters)
        """
        C = Earth.r / np.sqrt(1 - (Earth.e * np.sin(lat)) ** 2)

        S = Earth.r * (1 - Earth.e ** 2) / np.sqrt(1 - (Earth.e * np.sin(lat)) ** 2)