Skip to content

Commit

Permalink
Add R1(), R2(), R3() from Almanac _Supplement_
Browse files Browse the repository at this point in the history
Fixes #1020.
  • Loading branch information
brandon-rhodes committed Jan 5, 2025
1 parent d9e82c9 commit 101d46a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions skyfield/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ def rot_z(theta):
one = zero + 1.0
return array(((c, -s, zero), (s, c, zero), (zero, zero, one)))

# The rotation matrices R1, R2, and R3 in _The Explanatory Supplement to
# the Astronomical Almanac_ use a left-handed rotation around the x and
# z axes. In case anyone needs them:

def R1(theta): return rot_x(-theta)
def R2(theta): return rot_y(theta)
def R3(theta): return rot_z(-theta)

def angular_velocity_matrix(angular_velocity_vector):
x, y, z = angular_velocity_vector
zero = x * 0.0
Expand Down

0 comments on commit 101d46a

Please sign in to comment.