- #1
m4r35n357
- 658
- 148
OK, just a bit of fun . . . hope no-one is too offended ;)
Inspired by the Newtonian orbit example here: http://www.travisglines.com/tag/runge-kutta, I thought I'd see how much GR I could do in JavaScript/HTML5 canvas. So, I got a side-by-side Newton/Schwarzschild demo going, code here: https://www.box.com/s/a514bd0a108e7717ab09. I stopped when I got bored, and I'm not into HTML, so I didn't make any controls for it; there are two scenarios commented in the JS code which you will need to edit to taste. By default it displays a borderline unstable decaying circular orbit against the Newtonian "equivalent", using the effective potential equations from MTW chapter 25 (Euler integration seems be more accurate than the RK4 on the original site, which has horrible precession for a Newton orbit).
Feel free to take/use/ignore with impunity, I'm sort of leaning towards trying a Boyer-Lindquist version, but not decided yet.
Of course, if you are looking for accuracy just go with GROrbits!
Inspired by the Newtonian orbit example here: http://www.travisglines.com/tag/runge-kutta, I thought I'd see how much GR I could do in JavaScript/HTML5 canvas. So, I got a side-by-side Newton/Schwarzschild demo going, code here: https://www.box.com/s/a514bd0a108e7717ab09. I stopped when I got bored, and I'm not into HTML, so I didn't make any controls for it; there are two scenarios commented in the JS code which you will need to edit to taste. By default it displays a borderline unstable decaying circular orbit against the Newtonian "equivalent", using the effective potential equations from MTW chapter 25 (Euler integration seems be more accurate than the RK4 on the original site, which has horrible precession for a Newton orbit).
Feel free to take/use/ignore with impunity, I'm sort of leaning towards trying a Boyer-Lindquist version, but not decided yet.
Of course, if you are looking for accuracy just go with GROrbits!