Earth-sized Sphere with Topography

version (2.87 KB) by Will Campbell
variation on the SPHERE command to facilitate plotting of orbital trajectories


Updated Thu, 01 Sep 2016 15:14:20 +0000

View License

Do you plot Earth-orbiting trajectories? Would you like to know how your orbit compares to the size of the Earth? If so, EARTH_SPHERE will help get you there.
This function is a modification of the built-in MATLAB command SPHERE. Rather than producing a sphere with a radius of 1, the radius of the sphere will equal that of the Earth. The user may specify the units they want to plot in: meters, kilometers, feet, miles, nautical miles, or astronomical units. EARTH_SPHERE will also display the Earth's topography in Earth-Centered-Earth-Fixed coordinates.

produces an earth-sized sphere in nautical miles

produces 10 point mesh of the Earth in astronomical units

h1 = gca;
hold on
produces the Earth in miles on axis h1 and plots a trajectory from variables x, y, and z

Cite As

Will Campbell (2022). Earth-sized Sphere with Topography (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
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!