For solar system visualizations, we use the ecliptic reference frame rather than the J2000 equatorial frame because:
Natural for planetary motion: The ecliptic plane is defined by Earth's orbit around the Sun, and most planets orbit within a few degrees of this plane
Simpler visualization: Planetary inclinations are small relative to the ecliptic (typically < 7°), making the solar system's disk-like structure apparent
Direct from ephemerides: Most planetary orbital elements from JPL Horizons are already given relative to the ecliptic
Educational clarity: Shows why ancient astronomers could predict planetary positions - they all follow nearly the same path across the sky
Both frames share the same origin (solar system barycenter) and x-axis direction (vernal equinox), but differ in their fundamental plane:
Ecliptic Frame:
XY plane: Earth's orbital plane (ecliptic)
Z-axis: Points to ecliptic north pole
Natural for: Planets, asteroids, comets
J2000 Equatorial Frame:
XY plane: Earth's equator (projected onto celestial sphere)
Z-axis: Points to celestial north pole
Natural for: Earth satellites, star positions
Tilted ~23.4° from ecliptic frame
The below images show the orbital transformations for Earth on July 29, 2025 from the perifocal frame to the ecliptic frame. This is the complete html file allowing you to fully visualize the transformations. (File size: 4.4 MB)
The above image illustrates the Earth's orbit in the perifocal frame before it is aligned with the ecliptic.
The semi-major axis (a) and eccentricity (e) are used together in the polar equation for a conic section to calculate the distance (r) of the orbiting object from its central body for any given angle. The below image shows the possible conic sections. Most solar system orbits are ellipses. Interstellar objects that come into the solar system but do not orbit the sun form hyperbolic orbits.
The initial perifocal orbit is a simple 2D representation where the closest approach (periapsis) lies on the +X axis. It's created using this process:
The code first calculates the radius (r) for a series of angles (called the true anomaly, ν) that sweep around the orbit. It does this using a fundamental formula from orbital mechanics that directly incorporates a (semi-major axis) and e (eccentricity):
r=1+ecos(ν)a(1−e2)
The semi-major axis (a) sets the overall size of the orbit.
The eccentricity (e) determines its shape. An eccentricity of 0 is a perfect circle, while a value approaching 1.0 is a highly elongated ellipse.
Once the distance r is calculated for each angle ν, the code converts these polar coordinates into the Cartesian (x, y) coordinates needed for plotting:
x = r * cos(ν)
y = r * sin(ν)
In this initial perifocal frame, the orbit is flat, so the z coordinate is always zero. This process generates the simple, un-rotated (cyan-colored in our plot) orbit, which serves as the starting point for all subsequent transformations.
The perifocal frame is the orbit's natural coordinate system:
x-axis: Points toward periapsis (closest approach)
y-axis: 90° ahead in direction of motion
z-axis: Normal to orbital plane (right-hand rule)
The above image shows the Earth's perifocal orbit rotated by omega (argument of periapsis) in the counter-clockwise direction (right-hand rule).
Apply three rotations to orient the orbit in space:
The transformation is a simple but crucial first step in building the 3D orbit.
The Starting Point: The visualization begins with the simple, 2D "perifocal" orbit (the cyan trace). In this frame, the orbit's closest point (periapsis) is conveniently placed directly on the +X axis.
The argument of periapsis (ω) plays a dual role in an orbit: it is a key angle in the orbit's final orientation, and it is also the name of the first rotational step used to construct it.
The transformation process begins with the initial Perifocal Frame (the cyan orbit), where the orbit's closest point (periapsis) is conveniently aligned on the +X axis. The ω rotation takes this entire flat orbit and rotates it counter-clockwise around the Z-axis by the angle ω. The purple dashed orbit and the purple angle arc in the visualization show the exact result of this first step.
This initial rotation is a critical setup step. Its main purpose is to align the orbit's future "Line of Nodes"—the line that will act as a hinge for the upcoming tilt—with the X-axis of the new, rotated (purple) coordinate frame.
An Analogy: Tilting a Piece of Paper
Imagine the plot's background is a tabletop (the Ecliptic Plane) and the orbit is drawn on a piece of paper lying flat. The ω rotation is like turning the paper on the tabletop until your chosen hinge line is perfectly aligned with the X-axis. In the visualization, the purple X-axis becomes this hinge, perfectly set up for the next step: the inclination (i), which is a simple tilt around this axis.
It is important to distinguish the rotational step from the final definition of ω, which the visualization makes clear:
The ω Rotation (Purple Arc): This is a simple 2D rotation around the Z-axis that serves as a mechanical construction step to help build the final orbit.
The ω Angle (Red Arc): This is the final geometric angle as it exists in the fully transformed 3D orbit. It is measured in the final tilted orbital plane from the Ascending Node to the final Periapsis.
For an orbit with zero inclination like Earth's, the "Line of Nodes" is undefined because the orbital plane is the ecliptic plane and never crosses it.
In this situation, astronomers measure the periapsis from the primary celestial reference direction (the +X-axis on the Ecliptic plane): the Vernal Equinox. This single angle is called the Longitude of Perihelion (ϖ). To maintain the standard six-element format, this angle is conventionally split between the Longitude of the Ascending Node (Ω) and the Argument of Periapsis (ω), where ϖ = Ω + ω.
For Earth, the actual angle from the Vernal Equinox to its perihelion is ϖ ≈ 102.9°. Our visualization shows how this is represented by the conventional values of Ω = -11.3° and ω = 114.2°.
Now that your hinge (the Line of Nodes) is aligned with the X-axis, the inclination (i) is simply the act of tilting the paper up from the tabletop, using that X-axis as the hinge. As the above image shows, the Earth's inclination is near zero, so there is no tilt. The second image above shows Mercury's orbit, which is tilted 7 degrees to align with the plane of the ecliptic. Here is the full html plot of Mercury's transformations (File: 4.4 MB)
The above images show the final transformation of the perifocal orbits to final orbits with respect to the Ecliptic plan for both Earth and Mercury.
The very last step of the transformation is to rotate this entire tilted system by the angle Ω (Longitude of the Ascending Node) around the Z-axis.
This final rotation moves the Line of Nodes (the red dashed line) away from the X-axis and places it in its correct final orientation in the ecliptic plane.
The angle between the plot's main X-axis (the reference direction) and this final Line of Nodes is exactly what the Ω angle represents.
Our visualization shows this. The red Ω angle arc correctly sweeps from the reference direction (+X-axis on the Ecliptic frame) to the final, correctly placed Line of Nodes.
2. Rotate by i (inclination) around the new x-axis
Tilts orbital plane to correct angle relative to ecliptic
Rotate by Ω (longitude of ascending node) around original z-axis
Positions ascending node at correct angle from vernal equinox
Mathematical sequence: R = R_z(Ω) × R_x(i) × R_z(-ω)
This transforms from perifocal coordinates (x', y', z') to ecliptic coordinates (x, y, z).
Some objects require additional transformations:
Planetary Satellites
Satellite orbital elements are often given relative to their planet's equator, not the ecliptic. Required transformation:
Apply the three orbital element rotations (in planet's equatorial frame)
Transform from planet equatorial → ecliptic using planet's axial tilt
Example: Mars satellites need ~25.19° Y-rotation (Mars's obliquity)
Example: Uranus satellites need ~97.77° rotation (Uranus's extreme tilt)
Converting to J2000 Equatorial (if needed)
If equatorial coordinates are required for compatibility:
Rotate around x-axis by -ε (negative obliquity of ecliptic ≈ -23.4°)
This tilts from ecliptic plane → equatorial plane
The ecliptic frame provides the most natural and intuitive coordinate system for visualizing solar system dynamics. By using it consistently throughout our orrery, we can:
Display the solar system's disk-like structure clearly
Minimize transformation complexity for most objects
Maintain consistency with how orbital elements are typically published
Create educational visualizations that match astronomical observations
The transformation process elegantly separates an orbit's intrinsic properties (shape via a, e) from its orientation in space (via i, Ω, ω) and the object's position along the orbit (via M, E, ν).
JPL Horizons provides orbital elements in the reference frame most appropriate for each satellite:
A planetary equatorial plane is the imaginary plane extending from a planet's equator out into space. Each planet in our solar system has its own unique equatorial plane, determined by its specific rotational axis. For satellites orbiting in close proximity to a planet, their orbits are primarily influenced by that planet's gravity and equatorial bulge. Therefore, expressing their orbital elements relative to the planet's own equatorial plane provides the most accurate and simplest representation of their motion.
For instance, the ephemeris of a satellite in low Earth orbit is most practically expressed relative to Earth's equatorial plane. Similarly, the orbits of Jupiter's inner moons are best described in relation to Jupiter's equatorial plane.
For distant, irregular satellites, a third reference frame, the Laplace plane, is often used. This plane represents the average orbital plane of a satellite over long periods. The orientation of a satellite's orbit is subject to perturbations from both its host planet's equatorial bulge and the gravitational pull of the Sun.
For a satellite orbiting very close to its planet, the planetary perturbations dominate, and its orbit will precess (wobble) around the planet's equatorial plane.
For a very distant satellite, the Sun's gravitational influence is stronger, causing its orbit to precess around the ecliptic plane.
The Laplace plane provides a stable, intermediate reference for satellites where these two forces are of comparable magnitude. It is the plane about which the satellite's orbital plane precesses with a constant inclination.
The ecliptic plane is the plane of Earth's orbit around the Sun. It serves as a fundamental reference plane for the solar system. The orbits of most planets in our solar system lie close to this plane. For celestial objects in heliocentric (sun-centered) orbits or those whose orbits are significantly influenced by the Sun, their positions may be given relative to the ecliptic plane.
The key difference between a planet's equatorial plane and the ecliptic plane is the axial tilt of the planet. Earth's axis, for example, is tilted by approximately 23.5 degrees relative to a line perpendicular to the ecliptic plane. This tilt is what causes seasons on Earth.
The term J2000 refers to a standard astronomical reference frame. It specifies the orientation of the celestial coordinate system at a particular moment in time: 12:00 Terrestrial Time on January 1, 2000.
Because the Earth's rotational axis and the ecliptic plane are not perfectly fixed in space—they slowly change over time due to processes like precession and nutation—astronomers need a standard "snapshot" to which all measurements can be referenced. J2000 provides this standard. When orbital elements are given with respect to J2000, it means they are based on the orientation of the Earth's equator and the ecliptic as they were at that specific epoch. This allows for consistent and comparable calculations over time. In astronomy and physics, an epoch is a precise moment in time used as a reference point for measurements.
The J2000 frame is technically a realization of the International Celestial Reference System (ICRS), which is a highly precise and stable coordinate system based on the positions of distant quasars.
The goal is to take the six Keplerian elements and derive a state vector, which includes the position (x, y, z) and velocity (vx, vy, vz). Here's the process for finding the position:
Calculate Position in the 2D Orbital Plane: First, you determine the satellite's position on its simple, flat elliptical path. This uses the elements that define the orbit's shape and the satellite's place on it:
Eccentricity (e) defines the shape of the ellipse.
Semi-major axis (a) defines the size of the ellipse.
Mean Anomaly (M) defines the position at a given time.
Using these, you can calculate the true anomaly (ν), which is the actual angle of the satellite in its orbit relative to its closest point (periapsis). This gives you a 2D position in a coordinate system aligned with the orbit itself (called the perifocal frame).
Rotate into 3D Space 🔄: Next, you use the orientation elements to tilt and swivel this flat ellipse into its final 3D position in the reference frame (e.g., the J2000 equatorial frame). This is done with three specific rotations:
First Rotation (Argument of Periapsis, ω): This orients the ellipse within its orbital plane. It rotates the orbit so that the point of closest approach is correctly positioned relative to the ascending node.
Second Rotation (Inclination, i): This tilts the entire orbital plane relative to the reference plane (like the equator). This is a rotation around the line of nodes.
Third Rotation (Longitude of the Ascending Node, Ω): This final rotation swivels the tilted orbit into its correct position around the central body. It aligns the ascending node with its measured direction in the reference frame.
After these three rotations, you have the final (x, y, z) coordinates ready for plotting.
In an x, y, z frame where the reference plane is the x-y plane (e.g., the equator), the orbital elements have very direct visual meanings:
Inclination (i): This is the tilt of the plotted orbit. An inclination of 0° means the orbit lies flat in the x-y plane, and the z-coordinate will always be zero. An inclination of 90° means the orbit is perpendicular to the x-y plane, creating a path that goes directly over the north and south poles.
Longitude of the Ascending Node (Ω): This is the swivel of the plotted orbit. It controls where the orbit crosses the x-y plane from south to north. An Ω of 0° means the ascending node is on the x-axis. An Ω of 90° means it's on the y-axis.
Argument of Periapsis (ω): This controls the orientation of the ellipse within its tilted plane. It determines where the orbit's low point (periapsis) is located. For example, in a highly inclined orbit, a ω of 90° would place the periapsis at the orbit's northernmost point. A ω of 270° would place it at the southernmost point.
Apply the classical sequence of rotations to transform from orbital elements to 3D Cartesian coordinates:
Standard rotation sequence (in the satellite's reference frame):
1. Rotation 1: Longitude of ascending node (Ω) around Z-axis
2. Rotation 2: Inclination (i) around X-axis
3. Rotation 3: Argument of periapsis (ω) around Z-axis
All orbital objects require the same rotational transformations, regardless of what they orbit.
ALL orbital objects use the same 6 elements:
Semi-major axis (a) - orbit size
Eccentricity (e) - orbit shape
Inclination (i) - orbital plane tilt
Ascending node (Ω) - orbital plane orientation
Argument of periapsis/perihelion (ω) - ellipse orientation within plane
True anomaly (ν) - position in orbit
Here are real examples with links to animated orbit visualizations:
Earth: i = 0.005°, Ω = 348.7°, ω = 115.2°
Mars: i = 1.848°, Ω = 49.6°, ω = 286.5°
Jupiter: i = 1.305°, Ω = 100.6°, ω = 275.1°
Halley: i = 162.2°, Ω = 59.1°, ω = 112.2°
Churyumov-Gerasimenko: i = 7.0°, Ω = 50.1°, ω = 12.8°
NEOWISE: i = 128.9°, Ω = 61.0°, ω = 37.3°
Apophis: i = 3.3°, Ω = 204.1°, ω = 126.4°
Bennu: i = 6.0°, Ω = 2.1°, ω = 66.2°
Ceres: i = 10.6°, Ω = 80.4°, ω = 73.6°
Pluto: i = 17.2°, Ω = 110.3°, ω = 113.8°
Eris: i = 44.0°, Ω = 35.9°, ω = 151.0°
Sedna: i = 11.9°, Ω = 144.4°, ω = 311.6°
The 3 rotations are fundamental to 3D space:
Rotation 1 (Ω): Rotates orbital plane around reference direction
Rotation 2 (i): Tilts orbital plane
Rotation 3 (ω): Rotates ellipse within the tilted plane
This works for ANY central body because:
The mathematics of orbital mechanics are universal
Gravity follows the same inverse-square law everywhere
3D space transformation rules are identical
The reference frame (ecliptic plane) is the same
Terminology changes:
Planets/Comets/Asteroids: "argument of perihelion" (closest to Sun)
Satellites: "argument of periapsis" (closest to planet)
Binary stars: "argument of periastron" (closest to companion star)
Reference planes vary:
Heliocentric objects: Measured from ecliptic plane
Planetary satellites: Often measured from planet's equatorial plane
But the rotations work the same way!
So whether it's Phobos around Mars, Halley's Comet around the Sun, or Pluto in the outer solar system, they all use the exact same three rotational transformations to define their orbital orientation in 3D space!
At this point, we have the orbit in the satellite's native reference frame (equatorial or Laplace plane).
Next: transform from the satellite's reference frame to our target ecliptic frame. This step varies by planetary system:
🔴 Mars Satellites (Phobos, Deimos)
Transformation: Y-axis rotation by Mars's axial tilt (25.19°)
mars_tilt = 25.19° // Mars axial tilt
Apply Y-axis rotation by mars_tilt
This accounts for Mars's equatorial plane being tilted relative to the ecliptic.
🪐 Saturn's Phoebe (Irregular Satellite)
Multi-step transformation from Laplace plane:
1. Laplace plane to Saturn's orbital plane (17° X-axis rotation)
2. Node correction (-30° Z-axis rotation)
3. Transform to ecliptic using Saturn's orbital elements
- Saturn's ascending node: 113.665°
- Saturn's inclination: 2.485°
Phoebe orbits far from Saturn, so its elements are given relative to the Laplace plane.
🌀 Uranus Satellites
Dual rotation for extreme axial tilt:
Uranus's extreme 97.77° axial tilt requires compound rotation:
1. X-axis rotation by 105° (empirically determined)
2. Y-axis rotation by 105°
The unusual geometry requires rotation around both X and Y axes.
Apply final corrections and time-dependent variations:
🔧 Normal Vector Correction
The most sophisticated refinement compares the orbital plane orientation between idealized and actual ephemeris data:
Step 4a: Calculate Orbital Plane Normals
For actual orbit data:
- Take 3 evenly spaced points from JPL ephemeris
- Calculate vectors: v1 = point2 - point1, v2 = point3 - point1
- Normal vector: n_actual = cross_product(v1, v2) / |cross_product|
For idealized orbit:
- Generate orbit points using transformed orbital elements
- Calculate normal the same way: n_ideal = cross_product(v1_ideal, v2_ideal)
Step 4b: Calculate Correction Rotation
rotation_axis = cross_product(n_ideal, n_actual)
rotation_angle = arccos(dot_product(n_ideal, n_actual))
Step 4c: Apply rotation correction to all idealized orbit points
Real Example - Phoebe:
Actual orbit normal: [0.1242, 0.0025, 0.9922]
Ideal orbit normal: [0.1814, -0.1036, 0.9779]
Correction: 7.2° rotation around axis [0.5204, 0.8539, 0.0143]
This correction accounts for:
✅ Small errors in reference frame transformations
✅ Approximations in orbital element definitions
✅ Perturbations not captured in idealized models
🕐 Time-Varying Elements
Different satellites experience varying rates of orbital evolution.
📚 Key Definitions:
Basic Precession: The gradual rotation of an orbital plane or orbital ellipse due to gravitational perturbations. Like a spinning top that wobbles, satellite orbits slowly change orientation over time.
Major Perturbations: Large gravitational influences beyond the simple two-body problem (satellite + planet). For the Moon, the Sun's gravity creates significant perturbations. For close satellites, the planet's non-spherical shape (J2 effect) dominates.
Node Regression: The backward drift of the ascending node (where orbit crosses reference plane). The orbital plane rotates like a coin spinning on a table. For the Moon, this takes 18.6 years per complete cycle.
Apsidal Precession: The rotation of the orbital ellipse within its plane. The line connecting periapsis (closest point) to apoapsis (farthest point) slowly rotates. For the Moon, this cycle takes 8.85 years.
Evection: A periodic variation in orbital eccentricity (how elliptical the orbit is). The Moon's orbit becomes more or less elliptical on a monthly cycle due to the changing Sun-Earth-Moon geometry.
🔴 Mars Satellites (Fast Changes): For satellites like Phobos and Deimos, J2 perturbations cause rapid precession:
Phobos: Ω = -158°/year, ω = +27°/year (very close to Mars)
Deimos: Ω = -7.6°/year, ω = +0.84°/year (more distant)
🌙 Earth's Moon (Complex Multi-Term Model): The Moon has the most sophisticated time-varying model due to its size and solar perturbations:
Basic precession (over ~18.6 years):
Omega = 125.08 - 0.0529538083 × days_since_J2000 // Node regression
omega = 318.15 + 0.1643573223 × days_since_J2000 // Apsidal advance
Major perturbations:
M_moon = (134.963 + 13.064993 × days) % 360 // Moon's mean anomaly
M_sun = (357.529 + 0.98560028 × days) % 360 // Sun's mean anomaly
D = (297.850 + 12.190749 × days) % 360 // Mean elongation
Evection (largest perturbation):
e_correction = 0.01098 × cos(2×D - M_moon)
e_total = 0.0549 + e_correction
Key Lunar Phenomena:
Node regression: 18.6-year cycle (due to solar torque)
Apsidal precession: 8.85-year cycle
Evection: Monthly eccentricity variation (up to ±0.01)
Variation: Periodic changes in orbital speed
Annual equation: Yearly variations due to Earth's elliptical orbit
🪐 Outer Planet Satellites (Slow Changes): Jupiter and Saturn satellites have much slower rates:
Io: ~0.7°/year precession
Titan: ~0.0001°/year precession
General time-varying calculation:
years_elapsed = (current_date - base_date) / 365.25
Omega_current = base_Omega + (dOmega_dt × years_elapsed)
omega_current = base_omega + (domega_dt × years_elapsed)
For Moon, add periodic terms:
+ perturbation_corrections (M_moon, M_sun, D)
The critical insight is recognizing which reference frame JPL Horizons uses for each satellite:
Documentation clues: Headers often specify "equatorial plane" or "Laplace plane"
Physical reasoning: Close satellites typically use equatorial; distant ones use Laplace
Empirical validation: Compare transformed orbits with actual ephemeris data
Different planetary systems require different approaches:
Simple tilt: Mars, Jupiter (single rotation by axial tilt)
Complex geometry: Uranus (compound rotations for extreme tilt)
Laplace plane: Saturn's Phoebe (multi-step through intermediate frames)
Time-varying complexity: Moon (sophisticated multi-term perturbation model)
The transformation accuracy is validated by comparing the computed orbital positions with JPL Horizons ephemeris data. Typical residuals:
Mars satellites: ~10-20° angular offset (acceptable for visualization)
Saturn's regular moons: High accuracy with simple tilt
Uranus satellites: Good alignment after dual rotation
Saturn's Phoebe: Excellent match after multi-step transformation
Moon: Complex model required due to solar perturbations and size
🔬 Scientific Impact: This transformation process enables accurate orbital mechanics calculations, mission planning visualizations, and educational displays that correctly represent satellite motion in a unified coordinate system.
This multi-step transformation process successfully converts JPL Horizons ephemerides from their native reference frames into a unified ecliptic coordinate system. The key is understanding that different satellites use different reference frames based on their orbital characteristics, and applying the appropriate geometric transformations to account for planetary axial tilts and the complex dynamics of irregular satellites.
The implementation demonstrates how astronomical software must bridge between theoretical orbital mechanics and practical computational challenges, requiring both physical insight and empirical validation to achieve accurate results.
For technical implementation details, code, and interactive visualizations, visit the full project documentation. Written and illustrated with Claude 4 and Gemini 2.5.