image thumbnail

3D Earth and Celestial Bodies (planet3D)

version 4.0.0 (87.9 MB) by Tamas Kis
Creates high-resolution renderings of the Earth and the major celestial bodies in our solar system for space mechanics applications.

201 Downloads

Updated 28 Aug 2021

From GitHub

View license on GitHub

Editor's Note: This file was selected as MATLAB Central Pick of the Week

planet3D View 3D Planets and Celestial Bodies (planet3D) on File Exchange

Creates high-resolution renderings of the Earth and the major celestial bodies in our solar system for space mechanics applications.

Syntax

planet3D(planet)
planet3D(planet,opts)

NOTE: Use the background function (see below) to set the plot background. When using background to set the plot background, the function call on background must occur before the function call on planet3D, otherwise the background will be plotted over the celestial body.

Description

planet3D(planet) draws the celestial body specified by planet, which can be input as 'Sun', 'Moon', 'Mercury', 'Venus', 'Earth', 'Earth Cloudy', 'Earth Night', 'Earth Night Cloudy', 'Earth Coastlines', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune', or 'Pluto'.

planet3D(planet,opts) does the same as the syntax above, but allows for the specification of optional plotting parameters. opts is a struct that has the following fields:

  • color → specifies line color
  • line_width → specifies line width
  • line_style → specifies line style
  • position → specifies the position of the center of the celestial body
  • reference_plane → specifies which reference plane the celestial body is drawn with respect to. If specified as equatorial, the reference plane is taken to be the equatorial plane of the celestial body. If specified as ecliptic, the celestial body will be tilted by the obliquity (i.e. the angle between the ecliptic plane and the equatorial plane).
  • theta → specifies the rotation angle about the 3rd axis of the celestial body (in degrees)
  • units → specifies the units the celestial body should be drawn in. Units available are 'AU', 'ft', 'km', 'm', 'mi', and 'nmi'.
  • transparency → specifies how transparent the celestial body is (1 for 100% transparency, 0 for 100% opacity)

NOTE: All fields of opts do NOT have to be defined; when a field is left undefined, the rest of the plot settings are set to default values. Additionally, color, line_width, and line_style are only relevant when plotting the Earth's coastlines.





background

Sets the plot background for drawing celestial bodies in 3D.

Syntax

background(spec)

NOTE: The function call on background must occur before the function call on planet3D.

Description

background(spec) sets the plot background for drawing celestial bodies in 3D. spec refers to the specified background, and can be set to 'Black', 'Stars', or 'Milky Way'.





Examples and Additional Documentation

Cite As

Tamas Kis (2021). 3D Earth and Celestial Bodies (planet3D) (https://github.com/tamaskis/planet3D-MATLAB/releases/tag/v4.0.0), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2021a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.