1 const planetNames = { 2 mercury: "Mercury", 3 venus: "Venus", 4 earth: "Earth", 5 mars: "Mars", 6 jupiter: "Jupiter", 7 saturn: "Saturn", 8 uranus: "Uranus", 9 neptune: "Neptune" 10 }; 11 12 /** 13 * Planet Data 14 * 15 * Elements: 16 * 0: Name 17 * 1: tp_PeriodOrbit 18 * 2: long_LongitudeEpoch 19 * 3: peri_LongitudePerihelion 20 * 4: ecc_EccentricityOrbit 21 * 5: axis_AxisOrbit 22 * 6: incl_OrbitalInclination 23 * 7: node_LongitudeAscendingNode 24 * 8: theta0_AngularDiameter 25 * 9: v0_VisualMagnitude 26 */ 27 const planetData = [ 28 [planetNames.mercury, 0.24085, 75.5671, 77.612, 0.205627, 0.387098, 7.0051, 48.449, 6.74, -0.42], 29 [planetNames.venus, 0.615207, 272.30044, 131.54, 0.006812, 0.723329, 3.3947, 76.769, 16.92, -4.4], 30 [planetNames.earth, 0.999996, 99.556772, 103.2055, 0.016671, 0.999985, -99.0, -99.0, -99.0, -99.0], 31 [planetNames.mars, 1.880765, 109.09646, 336.217, 0.093348, 1.523689, 1.8497, 49.632, 9.36, -1.52], 32 [planetNames.jupiter, 11.857911, 337.917132, 14.6633, 0.048907, 5.20278, 1.3035, 100.595, 196.74, -9.4], 33 [planetNames.saturn, 29.310579, 172.398316, 89.567, 0.053853, 9.51134, 2.4873, 113.752, 165.6, -8.88], 34 [planetNames.uranus, 84.039492, 356.135400, 172.884833, 0.046321, 19.21814, 0.773059, 73.926961, 65.8, -7.19], 35 [planetNames.neptune, 165.845392, 326.895127, 23.07, 0.010483, 30.1985, 1.7673, 131.879, 62.2, -6.87] 36 ]; 37 38 function getPlanetData(planetName) { 39 let [planet_name, tp_PeriodOrbit, long_LongitudeEpoch, peri_LongitudePerihelion, ecc_EccentricityOrbit, axis_AxisOrbit, incl_OrbitalInclination, node_LongitudeAscendingNode, theta0_AngularDiameter, v0_VisualMagnitude] = ["not found", -99, -99, -99, -99, -99, -99, -99, -99, -99]; 40 41 for (let iLoop = 0; iLoop < planetData.length; iLoop++) { 42 if (planetData[iLoop][0] == planetName) { 43 planet_name = String(planetData[iLoop][0]); 44 tp_PeriodOrbit = Number(planetData[iLoop][1]); 45 long_LongitudeEpoch = Number(planetData[iLoop][2]); 46 peri_LongitudePerihelion = Number(planetData[iLoop][3]); 47 ecc_EccentricityOrbit = Number(planetData[iLoop][4]); 48 axis_AxisOrbit = Number(planetData[iLoop][5]); 49 incl_OrbitalInclination = Number(planetData[iLoop][6]); 50 node_LongitudeAscendingNode = Number(planetData[iLoop][7]); 51 theta0_AngularDiameter = Number(planetData[iLoop][8]); 52 v0_VisualMagnitude = Number(planetData[iLoop][9]); 53 54 break; 55 } 56 } 57 58 return [planet_name, tp_PeriodOrbit, long_LongitudeEpoch, peri_LongitudePerihelion, ecc_EccentricityOrbit, axis_AxisOrbit, incl_OrbitalInclination, node_LongitudeAscendingNode, theta0_AngularDiameter, v0_VisualMagnitude]; 59 }; 60 61 module.exports = { 62 planetNames, 63 planetData, 64 getPlanetData 65 }