Jump to content

Stargazers Lounge Uses Cookies

Like most websites, SGL uses cookies in order to deliver a secure, personalised service, to provide social media functions and to analyse our traffic. Continued use of SGL indicates your acceptance of our cookie policy.

sgl_imaging_challenge_banner_dslr_mirrorlesss_winners.thumb.jpg.9deb4a8db27e7485a7bb99d98667c94e.jpg

Oz Ramos

Plotting planets in 3D space?

Recommended Posts

I may be WAY over my head here, considering I don't know anything above highschool Algebra, but is there an equation/set of equations that would allow me to plot a planet in 3D space?

Stars and deep sky objects would be relatively simple (I think) as I could just pull it from any catalogue, but plotting where the planets would eludes me. So far I've read about Ephemerides, but because I don't know what I'm looking at it's a bit intimidating. Am I on the right path?

I'm building a simple web app that will let me log what I see each night, along with a photo/sketch, notes, and other metadata. The goal is to allow groups of people to observe the same objects or sections of the sky collaboratively - in my mind, a mashing of Stellarium and SoundCloud. What would happen is if someone picks for example, Saturn, and zooms into it like in Stellarium, instead of seeing a 3D model you would see an image with their notes taken by someone else, at random.

Users should be able to select any date in the recent past (< 100 years) to upload old information, and a few months/years in the future if they need to plan ahead. The language I'd build this in is Javascript, but really I'm more concerned with the math involved (I'm a web developer).

Thanks!

Share this post


Link to post
Share on other sites

The maths is Kepler's Laws, i.e. Newtonian gravity (or general relativity if you want to be really accurate). Get a hold of the book Astronomical Algorithms by Jean Meeus. I don't support piracy but there are pirate pdfs online if you don't want to get it from a library or bookshop (just google).

Share this post


Link to post
Share on other sites

Thanks acey just ordered it. I'm actually interested in understanding the math involved as well so I'm planning on getting an Algebra textbook and bringing myself back to speed. Say my goal was to understand the physics involved, would the next step be Calculus?

I think if I understand the math I might be able to get fancier with my programs.

Share this post


Link to post
Share on other sites

plotting orbits with one body orbiting another is quite easy, the problem starts when a third or more body is added to the system, for planets their orbits are very predictable using keplers laws, and the minor other body effects can be ignored. But for ultimate accuracy a running maths model is needed, that calculates gravitational forces with each micro step. Truly accurate Formulas for three body systems don't exist I believe. Could be wrong normally am......

Share this post


Link to post
Share on other sites

It's a bit like trying to predict the weather, their are an infinite number of external effects (matter, dark matter, radiation and astrologers) to take into account - impossible to predict accurately far off into the future.

But we do very well for the near future, so it's not that bad :)

Edited by Cath

Share this post


Link to post
Share on other sites

an infinite number of external effects (matter, dark matter, radiation and astrologers) to take into account - impossible to predict accurately far off into the future.

That's hilarious!

I've read somewhere that the pull of Jupiter on the sun actually causes the two to orbit around a common origin outside the sun, so I'd imagine it would have a noticeable affect on other planets. I'm not too worried about hyper-accuracy, the app is more of a collaboration tool for astronomers than a tool like Stellarium.

I borrowed a book from the library called "Astronomy on the Personal Computer" while I wait for the other one to come in, and I'm starting to make some basic models in Javascript.

That link you sent me Bujin was super intimidating at first, but I think I might actually get this soon..ish!

This whole thing will be open sourced once it's finished, and I'll be posting demos as I build it somewhere.

Thanks again!

  • Like 1

Share this post


Link to post
Share on other sites

Without going into too much detail, the info is there to read on the wolfram site, but I'd strongly recommend you to have a look at Mathematica. Half the battle is doing the job with the right tools. Of course nothing is impossible with another language, but Mathematica is made for this kind of thing. Well worth it if you want to get into scientific programming especially, it makes your job a hell of a lot easier IF you are willing to put in the time and learn it, there is a bit of an initial overhead I must admit.

There are many useful demonstrations with source code and a whole section on astronomy for mathematica, so you can get some ideas as to the kind of calculations you are talking about. If using mathematica only for part of it can still be helpful, as it can be integrated with Java or any other language for that matter, including web apps.

http://www.wolfram.com/

Don't mean to spam, almost sounds like one of those posts, but I have used it myself over the years and I swear by this tool how useful it is in scientific work, or anything involving math. :)

Share this post


Link to post
Share on other sites

Theirs some info here that will produce planet positions to within 1 arc minute ..

http://www.stjarnhimlen.se/comp/ppcomp.html

But if you need really accurate 3D positions then you can use JPL's cspice code ..

http://naif.jpl.nasa.gov/naif/toolkit.html

A quick and simple example using it .. http://stackoverflow.com/questions/16222505/modelling-the-solar-system-in-opengl

Share this post


Link to post
Share on other sites

I actually never thought to search Mathematica. I used to use the WolframAlpha search engine as a starting point for math questions, but never thought to look there. It came up with some good stuff.

I wish I had come across that first link sooner Cath! I love that they just use straight, non language-specific math.

Thanks for the information everyone, this has given me plenty to refer to whenever I get stuck...and I've been stuck a lot already :p

Share this post


Link to post
Share on other sites

One other thing to consider is that gravitational equations arent really complete without relativity. If I remember correctly, the orbit of Mercury has an error due to it passing through warped spacetime (proximity to sun). Although in all honesty you'd probably get a close enough approximation :) The effect is likely to be negligible on the other solar system bodies.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.