View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
3D Visualization of SUN, EARTH and Moon

4.7 | 3 ratings Rate this file 23 Downloads (last 30 days) File Size: 1.17 MB File ID: #42658 Version: 1.0
image thumbnail

3D Visualization of SUN, EARTH and Moon



3D Visualization of SUN, EARTH and Moon

| Watch this File

File Information

Function SSEM displays 3D Visualization of SUN, EARTH and Moon with two option i.e. with actual data and without actual data just for fun.

SSEM('fun'); just for fun.
SSEM('actual'); For actual viewing.

Physics has been kept simple.

I've created this just for fun and to have a look about graphics capabilities of MATLAB. Any user can use and modify it and have fun.

At starting ain't able to rotate EARTH and MOON on its axis so if any one can do it I'll appreciate it.

Hope you'll enjoy it.

Required Products MATLAB
MATLAB release MATLAB 7.14 (R2012a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
04 Dec 2015 Ashish Meshram (Meet)

Greeting Jonathan Pound-Espericueta that's wonderful.
Would love to watch it...why don't you submit it...

Comment only
04 Dec 2015 Jonathan Pound-Espericueta

Hello, Ashish Meshram! I edited the code to allow for Mars. The orbital plane of Mars is inclined to that of Earths as well.

Comment only
24 Nov 2015 Ashish Meshram (Meet)

Hi Jonathan Pound-Espericueta

Right now SSEM is implemented only for SUN, EARTH, and MOON.
But no doubt it can be extended to all. Its upto you. And I haven't been giving time to it. I'll appreciate if you can do it.

Comment only
23 Nov 2015 Jonathan Pound-Espericueta

How would I go about adding another planet to this code such as Mars? Is the SSEM function defined only for the Sun, Earth & Moon?


17 Apr 2015 Mingjing

Happened to come across your submission; What you did was really cool. BTW, the reason why EARTH and MOON don't rotate is because in every iteration of the loop, their positions are calculated again from scratch(e.g. set(HEARTH,'xdata',xEarth(k) + Rm(2)*X...). This effectively resets the 'rotation angle' back to 0. Therefore, instead of specifying a fixed angle, you must use a number that grows as iteration progresses. For instance:

rotate(HEARTH,[0,0,1],2*k,[xEarth(k) yEarth(k) zEarth(k)]);

Also, I suggest you make 'fun' a default parameter, since this is the only working parameter for now.

25 Aug 2014 Ashish Meshram (Meet)

Thanks Dr. Jens Koopmann, for appreciation. I hope you enjoyed it.

Comment only
24 Aug 2014 Dr. Jens Koopmann


I like your program. Initially I had problem to get it to run. There is a command called im2double -> I replaced it with double and it worked fine

Thanks for sharing.

16 Jul 2013 Ashish Meshram (Meet)

Ain't sure why ain't able to rotate EARTH and MOON on its own axis as mentioned on line 182 and 193...
Please any one can help me on it...

Comment only
16 Jul 2013 Ashish Meshram (Meet)

Run the following command on your command window and enjoy the view by using your mouse when rotate option is enabeled


Comment only

Contact us