-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobjectHandler.js
31 lines (27 loc) · 3.81 KB
/
objectHandler.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function loadObjs(){
objects = new Array();
//Pos and velocty are for 1am 9th Feb 2018 and based on J2000
//Data is from JPL's Horizons, with time given in TDB
objects.push({pos:[2.346851423244482e+8,9.455954689519937e+8,-1.713750298342091e+7], vel:[-1.060819103083714e1,8.197128522027960,2.549252942304885e-1], mass:1.988544e30, radius:6.955e8, name:'Sol', colour:'yellow'});
objects.push({pos:[3.203526385663218e10,-5.579278927493256e10,-7.570769981894959e9], vel:[3.274677250599233e4,2.623841795378953e4,-8.615431989134876e3], mass:3.302e23, radius:2440e3, name:'Mercury', colour:'grey', eccen:0.205630, peri:46001200e3});
objects.push({pos:[1.005559132871361e11,-4.085940902876824e10,-6.379774410814354e9], vel:[1.326334250604394e4,3.218378092683516e4,-3.243723071610614e2], mass:48.658e23, radius:6051.8e3, name:'Venus', colour:'#f9efe0', eccen:0.006772, peri:107477000e3});
objects.push({pos:[-1.127778299024784e11,9.587489286036640e10,-2.110791918997467e7], vel:[-1.966445116429642e4,-2.290767862883726e4,1.646516450870550], mass:5.97219e24, radius:6371.01e3, name:'Earth', colour:'#33ccff', eccen:0.0167086, peri:147095000e3});
objects.push({pos:[-1.129450940601557e11,9.551094217623965e10,1.367086378601938e7], vel:[-1.879709472713689e4,-2.334651686463613e4,-2.690920329895796e1], mass:734.9e20, radius:1737.4e3, name:'Luna', colour:'lightGrey', eccen:0.0549, peri:362600e3, satelliteOf:'Earth'});
objects.push({pos:[-2.020661629049368e11,-1.252917392715515e11,2.302428580790251e9], vel:[1.372366157709516e4, -1.847686259838255e4,-7.241417766012956e2], mass:6.4185e23, radius:3389.92e3, name:'Mars', colour:'#c63905', eccen:0.0934, peri:206700e6});
objects.push({pos:[-6.095691564102792e11,-5.345730020530473e11,1.585183076201335e10], vel:[8.461319358662680e3,-9.202324266518563e3,-1.510665562943512e2], mass:1898.13e24, radius:69911e3, name:'Jupiter', colour:'salmon', eccen:0.0489, peri:740.52e9});
objects.push({pos:[3.795432530621587e10,-1.504124948406416e12,2.464166052052850e10], vel:[9.126832780896530e3,2.118306853133337e2,-3.666576162676886e2], mass:5.68319e26, radius:58232e3, name:'Saturn', colour:'orange', eccen:0.0565, peri:1352.55e9});
objects.push({pos:[3.864275057831011e10,-1.503270298659880e12,2.413279677276343e10], vel:[4.612891785901849e3,3.361857704837679e3,-1.541835001301625e3], mass:13455.3e19, radius:2575.5e3, name:'Titan', colour:'green', eccen:0.0288, peri: 1186680e3, satelliteOf:'Saturn'});
objects.push({pos:[2.640663283998127e12, 1.375148663592631e12,-2.910287688135266e10], vel:[-3.195418162074442e3,5.722670257548083e3,6.287593388834489e1], mass:86.8103e24, radius:25362e3, name:'Uranus', colour:'lightBlue', eccen:0.046381, peri:2741.30e9});
objects.push({pos:[4.295813286313878e12,-1.267610940180017e12,-7.289729273236626e10], vel:[1.502086732141081e3,5.246019052556970e3,-1.419982017509147e2], mass:102.41e24, radius:24624e3, name:'Neptune', colour:'blue', eccen:0.0113, peri:4444.45e9});
//Low Accuracy objects
objects.push({pos:[-1.132395576738167e11,9.541808126609701e10,-1.540993578517437e8], vel:[-2.211433629471300e4,-2.548526894019828e4,-6.633379018966394e2], mass:1250, radius:3, name:'Starman', colour:'#ff2600'});
objects.push({pos:[-1.127777938492177e11,9.586814606814523e10,-2.185390498995781e7], vel:[-1.416240082154641e4,-2.345950635831443e4,5.304049224562815e3], mass:419455, radius:80, name:'ISS', colour:'skyBlue'});
//objects.push({pos:[-4.248568140855418e12,-1.675229634932457e13,1.212392529263620e13], vel:[-1.416240082154641e4,-2.345950635831443e4,5.304049224562815e3], mass:419455, radius:80, name:'ISS', colour:'skyBlue'});
for(var i=0;i<objects.length;i++){
objects[i].acc=[0.0,0.0,0.0];
objects[i].tail= new Array();
}
console.log("# Registed objects in handler: "+objects.length);
//t=1475636400000; //03:00 5/10/16 in UNIX time
t=1518138000000; //1am 9 Feb 2018 UTC UNIX timestamp
};