3D Trajectory Visualization¶
Three-dimensional trajectory plots display orbital paths in a central body's centered-inertial frame, providing intuitive spatial understanding of satellite motion. The plot_trajectory_3d function renders trajectories with an optional central body sphere, camera controls, and support for multiple orbits with different colors and labels. Earth is the default central body; other bodies (Moon, Mars, and any other body in the visual registry) are supported via the central_body parameter.
Interactive 3D Trajectory (Plotly)¶
The plotly backend creates fully interactive 3D plots. Click and drag to rotate, scroll to zoom, and double-click to reset the view.
Simple Texture (Interactive)¶
Blue Marble Texture¶
Note
Textures are provided as image-only in documentation to reduce page load times. Interactive versions can be generated using the provided code.
Natural Earth Texture¶
Plot Source
| trajectory_3d_plotly.py | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
The interactive visualization shows the ISS orbit in 3D space with Earth at the origin. You can:
- Rotate: Click and drag to change viewing angle
- Zoom: Scroll or pinch to zoom in/out
- Pan: Right-click and drag to pan
- Reset: Double-click to return to default view
Static 3D Trajectory (Matplotlib)¶
Matplotlib 3D Visualization Limitations
The matplotlib 3D backend does not have a true 3D perspective camera model. Instead is uses a 2D layering system where entire objects (e.g., the entire orbit line, the entire sphere surface) are drawn one on top of the other based on a single, fixed zorder value.
This can lead to visual artifacts where parts of objects that should be behind other objects are incorrectly drawn in front. For example, the far side of an orbit may appear in front of the Earth sphere.
The matplotlib backend produces publication-ready 3D figures with customizable viewing angles.
Plot Source
| trajectory_3d_matplotlib.py | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
Plotting Around Other Central Bodies¶
plot_trajectory_3d is not limited to Earth. The central_body parameter accepts either a registry key from brahe.plots.bodies.BODY_VISUALS ('earth', 'moon', 'mars', 'sun', and the other planets) or a custom dict {name, radius, texture} (radius in meters) for bodies outside the registry. Trajectories are plotted in the central body's centered-inertial frame (CelestialFrame.GCRF for Earth, CelestialFrame.LCI for the Moon, CelestialFrame.MCI for Mars, and so on); a trajectory declared in any other frame is converted to it with to_frame().
show_body(bool): show the central body sphere at the origin. Default:True.texture: texture for the central body sphere (plotly only). Accepts'simple','blue_marble'or'natural_earth_50m'/'natural_earth_10m'(Earth only), anybrahe.plots.texture_utils.PLANET_TEXTURESkey, or a path to an image file. Defaults to the central body's registry texture (or'simple'for custom bodies without one).additional_bodies: a list of extra textured spheres to draw alongside the central body, each a dict withposition(meters, in the same frame as the plotted trajectories),radius(meters),texture, andname.
The following example plots a lunar orbit around the Moon, with an Earth sphere included for scale via additional_bodies:
The Moon's registry texture and most planet textures are downloaded on first use from Solar System Scope and require attribution:
Body textures: Solar System Scope, CC BY 4.0.
The packaged blue_marble and downloaded natural_earth_50m/natural_earth_10m Earth textures are not part of that set and require no additional attribution.
See Also¶
- plot_trajectory_3d API Reference
- Synodic Plots - Trajectories in rotating two-body frames
- Ground Tracks - 2D projection on Earth's surface
- Orbital Elements - Element evolution over time
- Coordinate Systems - Understanding ECI frames