MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / radiusEarth

Method radiusEarth

libraries/relativity/relativity.h:122–132  ·  view source on GitHub ↗

returns radius in km.

Source from the content-addressed store, hash-verified

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

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64