-
March 10th, 2011, 03:09 PM
#1
solar system coordinates in java
Hi
I am making a simulation of the inner planets of the solar system using the three-step Beeman scheme. I am confused about how to display the planets. for my starting inputs I have the data from NASA JPL website, so for the Earth I have the following:
Code:
Planet Name positionX positionY velocityX(km/s) velocityY(km/s) radius acceleration mass(kg)
Earth -1.685246520883574E-01 9.687833042792607E-01 -1.723394582127405E-02 -3.007660313409631E-03 50 0 5.9736e+24
These values are huge so how do I convert these to the cartesian coordinates that JAVA uses?
Thanks
-
March 10th, 2011, 04:00 PM
#2
Re: solar system coordinates in java
These values are huge so how do I convert these to the cartesian coordinates that JAVA uses?
You scale them to fit the display area you have available to you.
Find the largest planet coordinate (call it A), find the largest screen co-ordinate you want to use (call it B) and divide all the planet coordinates by A and multiply them by B. This will give you the screen location co-ordinates.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|