# Path: beyond/utils/matrix.py
# def rot1(theta):
#     """
#     Args:
#         theta (float): Angle in radians
#     Return:
#         Rotation matrix of angle theta around the X-axis
#     """
#     return np.array(
#         [
#             [1, 0, 0],
#             [0, np.cos(theta), np.sin(theta)],
#             [0, -np.sin(theta), np.cos(theta)],
#         ]
#     )
# 
# 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],
#         ]
#     )


from pathlib import Path
from math import sin, cos, radians
from ..utils.matrix import rot1, rot2, rot3
from ..utils.memoize import memoize
import numpy as np
    return np.array([0, 0, 7.292115146706979e-5 * (1 - lod / 86400.0)])


def _earth_orientation(date):
    """Earth Orientation Parameters in degrees"""
    return date.eop.x / 3600.0, date.eop.y / 3600.0


def earth_orientation(date):  # pragma: no cover
    """Earth Orientation as a rotation matrix"""
    x_p, y_p = np.deg2rad(_earth_orientation(date))
    return rot1(y_p) @ rot2(x_p)


def _precesion(date):
    """Precession in degrees"""

    t = date.change_scale("TT").julian_century

    zeta = (2306.2181 * t + 0.30188 * t ** 2 + 0.017998 * t ** 3) / 3600.0
    theta = (2004.3109 * t - 0.42665 * t ** 2 - 0.041833 * t ** 3) / 3600.0
    z = (2306.2181 * t + 1.09468 * t ** 2 + 0.018203 * t ** 3) / 3600.0

    # print("zeta = {}\ntheta = {}\nz = {}\n".format(zeta, theta, z))
    return zeta, theta, z


def precesion(date):  # pragma: no cover
    """Precession as a rotation matrix"""
    zeta, theta, z = np.deg2rad(_precesion(date))

# Path: beyond/utils/matrix.py
# def rot1(theta):
#     """
#     Args:
#         theta (float): Angle in radians
#     Return:
#         Rotation matrix of angle theta around the X-axis
#     """
#     return np.array(
#         [
#             [1, 0, 0],
#             [0, np.cos(theta), np.sin(theta)],
#             [0, -np.sin(theta), np.cos(theta)],
#         ]
#     )
# 
# 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],
#         ]
#     )


# Path: beyond/frames/iau1980.py
from pathlib import Path
from math import sin, cos, radians
from ..utils.matrix import rot1, rot2, rot3
from ..utils.memoize import memoize
import numpy as np

    return np.array([0, 0, 7.292115146706979e-5 * (1 - lod / 86400.0)])


def _earth_orientation(date):
    """Earth Orientation Parameters in degrees"""
    return date.eop.x / 3600.0, date.eop.y / 3600.0


def earth_orientation(date):  # pragma: no cover
    """Earth Orientation as a rotation matrix"""
    x_p, y_p = np.deg2rad(_earth_orientation(date))
    return rot1(y_p) @ rot2(x_p)


def _precesion(date):
    """Precession in degrees"""

    t = date.change_scale("TT").julian_century

    zeta = (2306.2181 * t + 0.30188 * t ** 2 + 0.017998 * t ** 3) / 3600.0
    theta = (2004.3109 * t - 0.42665 * t ** 2 - 0.041833 * t ** 3) / 3600.0
    z = (2306.2181 * t + 1.09468 * t ** 2 + 0.018203 * t ** 3) / 3600.0

    # print("zeta = {}\ntheta = {}\nz = {}\n".format(zeta, theta, z))
    return zeta, theta, z


def precesion(date):  # pragma: no cover
    """Precession as a rotation matrix"""
    zeta, theta, z = np.deg2rad(_precesion(date))

    return rot3(zeta) @ rot2(-theta) @ rot3(z)