Lunar Orientation Visualizer

This page documents the operation, purpose, and mathematical conventions of the Lunar Orientation Visualizer.

Purpose

This tool provides an interactive visualization of lunar orientation specified by libration in longitude l, libration in latitude b, position angle c, and observer distance d from the lunar center (allowing both Earth-based and hypothetical observing geometries to be explored). The visualizer uses this libration state as its primary input.

The corresponding quaternion, rotation matrix, axis-angle representation, and Rodrigues vector are displayed automatically. These quantities are mathematically equivalent descriptions of the rigid-body rotation represented by the specified libration state. The visualizer therefore provides a direct connection between the traditional astronomical description of lunar orientation and the broader mathematical framework developed for three-dimensional rotations.

Why can't I enter a quaternion or matrix directly?

This is primarily a libration calculator, not a general-purpose rotation converter. The quantities l, b, and c are familiar to lunar observers, and correspond directly to an observable lunar orientation. By contrast, quaternions, rotation matrices, axis-angle representations, and Rodrigues vectors must satisfy strict mathematical constraints. Allowing arbitrary user entry would frequently produce invalid or inconsistent states. The visualizer therefore treats the libration state as the primary input and computes all other rotation representations automatically.

For Earth-based observations, physically observable librations occupy only a relatively small subset of the full orientation space. The visualizer is not restricted to those natural limits. Any mathematically valid orientation may be explored, including states that never occur in normal Earth-based observations. This makes the tool useful not only for studying lunar libration itself, but also for investigating rotational geometry, validating calculations, testing algorithms, and exploring non-Earth-based observing configurations.

Exploring Lunar Orientation

The Moon may be manipulated in two different ways:

(1) Changing the Libration State

The sliders and input fields directly control l, b, c and d. The current slider settings are represented by the visual orientation of the Moon model.

As the sliders change the libration state, the visualizer updates:

These are simply different mathematical descriptions of the same orientation.

(2) Rotating the Moon Directly

The Moon itself may also be rotated interactively with the mouse.

Clicking and dragging the Moon changes the libration state and immediately updates all derived quantities. This provides a convenient way to explore the geometry without entering numerical values.

Many users find it easier to rotate the Moon visually until a desired orientation is reached, and then examine the resulting libration and rotation parameters.

Viewing the Moon From Different Directions

The camera may be moved independently of the Moon.

Changing the camera position does not change the lunar orientation. It changes only the observer's viewpoint around the already-oriented Moon.

The two operations often produce similar visual effects, but represent fundamentally different geometric transformations. This distinction is particularly important when studying limb geometry, sub-observer locations, and three-dimensional orientation.

Why Display Quaternions and Matrices?

A lunar observer normally works with l, b, and c. Modern computational applications often require a complete rigid-body rotation instead.

Examples include:

The quaternion, matrix, axis-angle, and Rodrigues displays provide several equivalent descriptions of the same final lunar orientation.

Studying these quantities while varying libration can help build intuition about the geometry of three-dimensional rotations and the relationships among the different representations.

Why Are Euler Angles Not Displayed?

The purpose of this visualizer is to derive a unique lunar orientation from the observed libration state (l,b,c). Many rotation systems are based on Euler angles, which require the specification of a rotation sequence. Because different rotation orders produce different orientations, an Euler-angle representation is not uniquely defined without also specifying the chosen convention.

The orientation model is defined by two simultaneous geometric constraints: the sub-observer direction specified by (l,b), and the position angle c of projected lunar north. These constraints determine the final rigid-body attitude without assuming a rotation order.

The resulting attitude is represented exactly by M = Rz(c) Rx(b) Ry(-l), with the rightmost rotation acting first. This order is a consequence of the geometric constraints, not an independently imposed convention.

Users interested in Euler-angle formulations can easily convert the displayed quaternion or rotation matrix into any desired Euler-angle convention, but those representations are intentionally omitted from the primary display.

Coordinate Conventions

Exceptional Geometries and Representation Limits

The completed libration rotation M = Rz(c) Rx(b) Ry(-l) remains mathematically defined for all numerical angle triples. However, certain intermediate calculations and rotation representations have limitations.

Angular wrap-around and quaternion sign changes do not represent discontinuities in the physical rotation.

Validation

The conversions among the displayed quaternion, rotation matrix, axis-angle, and Rodrigues representations have been independently verified against the rotation conversion tools developed by Andre Gaschler. Agreement is obtained to numerical precision after accounting for differences in coordinate conventions and representation formats.

The quaternion computed from the libration state (l,b,c) has been verified against the eleven worked examples in the accompanying paper. Four of those examples (4, 6, 7, and 11) have nonzero tilt and roll together; they are the cases that distinguish the correct product order (roll about the line of sight applied after the tilt) from the reversed order, and are the recommended check for any independent implementation.

Mathematical Reference

A condensed summary of the orientation formulation implemented by this visualizer is provided in the accompanying lunar orientation formula sheet.

That sheet summarizes the orientation formulation implemented by this visualizer, and is adapted from a lunar rotations paper by the author. It contains the principal equations used to derive the displayed rotation representations from the libration state (l,b,c).