Solar System

Last updated:     2016-11-02 20:00    (9 months ago)

This page features a script which simulates the Solar System, and is automatically updated from the NASA Jet Propulsion Laboratory HORIZONS system every few hours. All times given are GMT.

Click here to download the script.

SolarSystem.lua
--Solar System Simulator (2016-11-02 20:00)
--Data retrieved live from NASA Jet Propulsion Laboratory HORIZONS system.
--http://www.jpl.nasa.gov/
 
--All distances are to scale, planet radii are enlarged 100x.
 
settitle("Solar System")
 
setinterval(10)
setscale(10^8)
sethistorylog(50000)
 
setcamera(0,0,3000)
setdirection(0,0,-1)
 
enablecollisions(0)
 
--Sun (MB:10)
 
x = 0.000000000000000*10^3
y = 0.000000000000000*10^3
z = 0.000000000000000*10^3
vx = 0.000000000000000*10^3
vy = 0.000000000000000*10^3
vz = 0.000000000000000*10^3
 
mass = 1.9891*10^30
radius = 6.955*10^8
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,0)
settext(id,"Sun")
 
--Mercury (MB:199)
 
x = -4.120048862176633*10^10
y = -5.436138854541033*10^10
z = -6.621711766589917*10^8
vx = *10^3
vy = 2.896066451341391*10^4
vz = -2.714529358301585*10^4
 
mass = 3.302*10^27
radius = 2440*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Mercury")
 
--Venus (MB:299)
 
x = 7.762671075638844*10^10
y = -7.622762370919599*10^10
z = -5.524760356535960*10^9
vx = 2.431127467482412*10^4
vy = 2.485756544979927*10^4
vz = -1.062072966088946*10^3
 
mass = 48.685*10^23
radius = 6051.8*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Venus")
 
--Earth (MB:399)
 
x = 1.126768704225551*10^11
y = 9.658447953281671*10^10
z = -4.618471626669168*10^6
vx = 1.988301774601447*10^4
vy = 2.250950635642242*10^4
vz = -6.649166319210309*10^-1
 
mass = 5.9736*10^24
radius = 6371.01*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Earth")
 
--Mars (MB:499)
 
x = 1.927194268325877*10^11
y = -7.432549052915423*10^10
z = -6.287282593801353*10^9
vx = 9.642951269288002*10^3
vy = 2.468071641733492*10^4
vz = 2.805407481227196*10^2
 
mass = 6.4185*10^23
radius = 3389.9*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Mars")
 
--Jupiter (MB:599)
 
x = -8.108418461401485*10^11
y = -8.854044812630013*10^10
z = 1.851127482570959*10^10
vx = *10^3
vy = 1.263129739104522*10^3
vz = -1.238200479853782*10^4
 
mass = 1.8986*10^27
radius = 71492*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Jupiter")
 
--Saturn (MB:699)
 
x = -3.252062864359481*10^11
y = -1.466345642342679*10^12
z = 3.843230449060732*10^10
vx = *10^3
vy = 8.905884156769208*10^3
vz = -2.132099290470326*10^3
 
mass = 5.68462313752*10^26
radius = 60268*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Saturn")
 
--Uranus (MB:799)
 
x = 2.757232666774480*10^12
y = 1.140374352043459*10^12
z = -3.146618752384722*10^10
vx = 2.649325800355955*10^3
vy = 5.963501999148525*10^3
vz = 5.640944203158549*10^1
 
mass = 8.6810*10^25
radius = 25559*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Uranus")
 
--Neptune (MB:899)
 
x = 4.230110523777655*10^12
y = -1.476482963702286*10^12
z = -6.708103716198391*10^10
vx = 1.758658635110756*10^3
vy = 5.153050625495699*10^3
vz = -1.468611710255945*10^2
 
mass = 1.0243*10^26
radius = 24764*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Neptune")
 
--Pluto (MB:999)
 
x = 1.417921353596334*10^12
y = -4.759783027302050*10^12
z = 9.899581255213833*10^10
vx = 5.343185888042236*10^3
vy = 4.286067638365985*10^2
vz = -1.592470552325718*10^3
 
mass = 1.305*10^22
radius = 1195*10^5
 
id = addbody(x,y,z,vx,vy,vz,mass,radius,1)
settext(id,"Pluto")