# 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
        - (5 * r + 134.1362608) * ttt
        + 0.0020708 * ttt ** 2
        + 2.2e-6 * ttt ** 3
    )

    delta_psi = 0.0
    delta_eps = 0.0
    for integers, reals in _tab(terms):
        a1, a2, a3, a4, a5 = integers
        A, B, C, D = reals

        a_p = a1 * m_m + a2 * m_s + a3 * u_m_m + a4 * d_s + a5 * om_m

        delta_psi += (A + B * ttt) * sin(radians(a_p)) / 36000000.0
        delta_eps += (C + D * ttt) * cos(radians(a_p)) / 36000000.0

    if eop_correction:
        delta_eps += date.eop.deps / 3600000.0
        delta_psi += date.eop.dpsi / 3600000.0

    return epsilon_bar, delta_psi, delta_eps


def nutation(date, eop_correction=True, terms=106):  # pragma: no cover
    """Nutation as a rotation matrix"""
    epsilon_bar, delta_psi, delta_eps = np.deg2rad(
        _nutation(date, eop_correction, terms)
    )
    epsilon = epsilon_bar + delta_eps


# 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

        - (5 * r + 134.1362608) * ttt
        + 0.0020708 * ttt ** 2
        + 2.2e-6 * ttt ** 3
    )

    delta_psi = 0.0
    delta_eps = 0.0
    for integers, reals in _tab(terms):
        a1, a2, a3, a4, a5 = integers
        A, B, C, D = reals

        a_p = a1 * m_m + a2 * m_s + a3 * u_m_m + a4 * d_s + a5 * om_m

        delta_psi += (A + B * ttt) * sin(radians(a_p)) / 36000000.0
        delta_eps += (C + D * ttt) * cos(radians(a_p)) / 36000000.0

    if eop_correction:
        delta_eps += date.eop.deps / 3600000.0
        delta_psi += date.eop.dpsi / 3600000.0

    return epsilon_bar, delta_psi, delta_eps


def nutation(date, eop_correction=True, terms=106):  # pragma: no cover
    """Nutation as a rotation matrix"""
    epsilon_bar, delta_psi, delta_eps = np.deg2rad(
        _nutation(date, eop_correction, terms)
    )
    epsilon = epsilon_bar + delta_eps


    return rot1(-epsilon_bar) @ rot3(delta_psi) @ rot1(epsilon)