returns radius in km.
| 120 | |
| 121 | // returns radius in km. |
| 122 | double radiusEarth(double longitude = 45) // 0..90 |
| 123 | { |
| 124 | // https://www.youtube.com/watch?v=hYMvJum9_Do @ 8:00 |
| 125 | // radius polar: 6357 km |
| 126 | // radius equator: 6378 km |
| 127 | // difference: 21 km |
| 128 | double radians = longitude * (PI / 180.0); |
| 129 | |
| 130 | // approx of the graph in YouTube with a cosine |
| 131 | return 6367.5 + 10.5 * cos(radians * 2); |
| 132 | } |
| 133 | |
| 134 | // mass in |
| 135 | double getPlanetMass(uint8_t n) // sun = 0; mercury = 1 etc |