# 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
from ..utils.matrix import rot1, rot2, rot3
from ..utils.memoize import memoize
import numpy as np

    X, Y, s_xy2 = _xysxy2(date)

    # convert milli-arcsecond to arcsecond
    dX, dY = date.eop.dx / 1000.0, date.eop.dy / 1000.0

    # Convert arcsecond to degrees then to radians
    X = np.radians((X + dX) / 3600.0)
    Y = np.radians((Y + dY) / 3600.0)
    s = np.radians(s_xy2 / 3600.0) - (X * Y / 2)

    return X, Y, s


def precesion_nutation(date):
    """Precession/nutation joint rotation matrix for the IAU2010 model"""

    X, Y, s = _xys(date)

    d = np.arctan(np.sqrt((X ** 2 + Y ** 2) / (1 - X ** 2 - Y ** 2)))
    a = 1 / (1 + np.cos(d))

    return (
        np.array(
            [
                [1 - a * X ** 2, -a * X * Y, X],
                [-a * X * Y, 1 - a * Y ** 2, Y],
                [-X, -Y, 1 - a * (X ** 2 + Y ** 2)],
            ]
        )

# 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/iau2010.py
from pathlib import Path
from math import sin, cos
from ..utils.matrix import rot1, rot2, rot3
from ..utils.memoize import memoize
import numpy as np


    X, Y, s_xy2 = _xysxy2(date)

    # convert milli-arcsecond to arcsecond
    dX, dY = date.eop.dx / 1000.0, date.eop.dy / 1000.0

    # Convert arcsecond to degrees then to radians
    X = np.radians((X + dX) / 3600.0)
    Y = np.radians((Y + dY) / 3600.0)
    s = np.radians(s_xy2 / 3600.0) - (X * Y / 2)

    return X, Y, s


def precesion_nutation(date):
    """Precession/nutation joint rotation matrix for the IAU2010 model"""

    X, Y, s = _xys(date)

    d = np.arctan(np.sqrt((X ** 2 + Y ** 2) / (1 - X ** 2 - Y ** 2)))
    a = 1 / (1 + np.cos(d))

    return (
        np.array(
            [
                [1 - a * X ** 2, -a * X * Y, X],
                [-a * X * Y, 1 - a * Y ** 2, Y],
                [-X, -Y, 1 - a * (X ** 2 + Y ** 2)],
            ]
        )

        @ rot3(s)