aboutsummaryrefslogtreecommitdiffstats
path: root/libtellurian.h
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-20 17:28:46 +0200
committerMattias Andrée <m@maandree.se>2024-10-20 17:28:46 +0200
commit09e6857ae73249bc7433f2971dcf291c70e4c766 (patch)
treef07ef152c6372083ab87e2e4289c7ab8b1f2c1ad /libtellurian.h
parentThird commit (diff)
downloadlibtellurian-09e6857ae73249bc7433f2971dcf291c70e4c766.tar.gz
libtellurian-09e6857ae73249bc7433f2971dcf291c70e4c766.tar.bz2
libtellurian-09e6857ae73249bc7433f2971dcf291c70e4c766.tar.xz
Fourth commit
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libtellurian.h')
-rw-r--r--libtellurian.h92
1 files changed, 68 insertions, 24 deletions
diff --git a/libtellurian.h b/libtellurian.h
index 2113f29..609f61d 100644
--- a/libtellurian.h
+++ b/libtellurian.h
@@ -40,7 +40,7 @@
/**
* The Earth's rectifying radius, in meters
*/
-#define LIBTELLURIAN_RECTIFYING_RADIUS 6367449.14582 /* 2π⁻¹∫{0 → ½π} √(a² cos² φ + b² sin² φ) dφ ≅ ∛(½(√a³+√b³))² */
+#define LIBTELLURIAN_RECTIFYING_RADIUS 6367449.145823328 /* 2π⁻¹∫{0→½π} √(a²cos²φ + b²sin²φ) dφ ≅ 1.5(a+b) - ½√[(3a+b)(a+3b)] */
/**
* The Earth's nominal equatorial radius, in meters
@@ -63,9 +63,11 @@
#define LIBTELLURIAN_EQUATORIAL_CIRCUMFERENCE 40075016.68557849 /* 2bπ */
/**
- * The Earth's meridional circumference, in meters
+ * The circumference, in meters, of a sphere inscribed in the Earth's
+ * spheroid and intersecting with it's pole (the circumference of
+ * a circle with Earth's polar radius)
*/
-#define LIBTELLURIAN_MERIDIONAL_CIRCUMFERENCE 39940652.74224401 /* 2bπ */
+#define LIBTELLURIAN_POLAR_CIRCUMFERENCE 39940652.74224401 /* 2bπ */
/**
* The Earth's mean circumference (arithmetic mean), in meters
@@ -85,33 +87,49 @@
/**
* The Earth's rectifying circumference, in meters
*/
-#define LIBTELLURIAN_RECTIFYING_CIRCUMFERENCE 40007862.91722943 /* 4 ∫{0 → ½π} √(a² cos² φ + b² sin² φ) dφ */
+#define LIBTELLURIAN_MERIDIONAL_CIRCUMFERENCE 40007862.91722943 /* 4 ∫{0 → ½π} √(a² cos² φ + b² sin² φ) dφ */
/**
- * The Earth's gravity at the equator, in meters per square-second
+ * The Earth's gravity at the equator, in meters per square second
*/
-#define LIBTELLURIAN_EQUATORIAL_GRAVITY 9.7803253359
+#define LIBTELLURIAN_EQUATORIAL_GRAVITY 9.7803253359 /* 𝔾ₑ */
/**
- * The Earth's gravity at the poles, in meters per square-second
+ * The Earth's gravity at the poles, in meters per square second
*/
-#define LIBTELLURIAN_POLAR_GRAVITY 9.8321849378
+#define LIBTELLURIAN_POLAR_GRAVITY 9.8321849378 /* 𝔾ₚ */
/**
- * The Earth's normal gravity at the equator, in meters per square-second
+ * The Earth's normal gravity at the equator, in meters per square second
*/
-#define LIBTELLURIAN_NORMAL_EQUATORIAL_GRAVITY 9.7803267715
+#define LIBTELLURIAN_NORMAL_EQUATORIAL_GRAVITY 9.78379185547421 /* ½𝔾ₑ + √((½𝔾ₑ)² + aω²) */
/**
- * The Earth's normal gravity at the poles, in meters per square-second
+ * The Earth's normal gravity at the poles, in meters per square second
*/
-#define LIBTELLURIAN_NORMAL_POLAR_GRAVITY 9.8321863685
+#define LIBTELLURIAN_NORMAL_POLAR_GRAVITY LIBTELLURIAN_POLAR_GRAVITY
/**
* The Earth's mass, in kilograms
*/
#define LIBTELLURIAN_MASS_OF_EARTH 5.972168e24
+/**
+ * The Earth's nominal mean angular velocity, in radians per second
+ */
+#define LIBTELLURIAN_ANGULAR_VELOCITY 7.292115e-5 /* ω */
+
+/**
+ * The geocentric gravitational constant, in cubic meters per square second
+ *
+ * This is the (universal) gravitational constant (6.67430e-11) multiplied
+ * by the mass of the Earth, however this value more reliable that the
+ * gravitation constant and the mass of th Earth, and should thus be used
+ * instead of multiplying the universial gravitational constant with the
+ * the msas of the Earth
+ */
+#define LIBTELLURIAN_GEOCENTRIC_GRAVITATIONAL_CONSTANT 3.986004418e14
+
/**
* Calculate the distance of the nominal sea level (geocentric
@@ -311,7 +329,7 @@ void libtellurian_end_point_radians(double latitude1, double longitude1, double
* as an oblate spheroid
*
* @param latitude GPS latitude coordinate, in degrees
- * @return The normal gravity, in meters per square-second
+ * @return The normal gravity, in meters per square second
*/
LIBTELLURIAN_CONST__
double libtellurian_normal_gravity(double latitude);
@@ -322,22 +340,48 @@ double libtellurian_normal_gravity(double latitude);
* as an oblate spheroid
*
* @param latitude GPS latitude coordinate, in radians
- * @return The normal gravity, in meters per square-second
+ * @return The normal gravity, in meters per square second
*/
LIBTELLURIAN_CONST__
double libtellurian_normal_gravity_radians(double latitude);
/**
+ * Calculate the effective gravity based on an already
+ * calculated normal gravity, that is, the normal gravity
+ * subtracted by a centrifugal correction based on the
+ * normal gravity and the latitude it is calculated from
+ *
+ * @param gravity The normal gravity, in meters per square second
+ * @param latitude GPS latitude coordinate, in degrees
+ * @return The effective gravity, in meters per square second
+ */
+LIBTELLURIAN_CONST__
+double libtellurian_effective_gravity(double gravity, double latitude);
+
+/**
+ * Calculate the effective gravity based on an already
+ * calculated normal gravity, that is, the normal gravity
+ * subtracted by a centrifugal correction based on the
+ * normal gravity and the latitude it is calculated from
+ *
+ * @param gravity The normal gravity, in meters per square second
+ * @param latitude GPS latitude coordinate, in radians
+ * @return The effective gravity, in meters per square second
+ */
+LIBTELLURIAN_CONST__
+double libtellurian_effective_gravity_radians(double gravity, double latitude);
+
+/**
* Calculate the gravity adjusted for the elevation
* above the altitude where the gravity is measure
*
* Altitudes above circa 100000 meters is out of range
* for this function (that would be in outer space)
*
- * @param gravity The gravity at sea level, in meters per square-second
+ * @param gravity The gravity at sea level, in meters per square second
* @param latitude GPS latitude coordinate, in degrees
* @param altitude Elevation above the gravity's measurement point, in meters
- * @return The height-adjusted gravity, in meters per square-second
+ * @return The height-adjusted gravity, in meters per square second
*/
LIBTELLURIAN_CONST__
double libtellurian_elevated_gravity(double gravity, double latitude, double altitude);
@@ -349,31 +393,31 @@ double libtellurian_elevated_gravity(double gravity, double latitude, double alt
* Altitudes above circa 100000 meters is out of range
* for this function (that would be in outer space)
*
- * @param gravity The gravity at sea level, in meters per square-second
+ * @param gravity The gravity at sea level, in meters per square second
* @param latitude GPS latitude coordinate, in radians
* @param altitude Elevation above the gravity's measurement point, in meters
- * @return The height-adjusted gravity, in meters per square-second
+ * @return The height-adjusted gravity, in meters per square second
*/
LIBTELLURIAN_CONST__
double libtellurian_elevated_gravity_radians(double gravity, double latitude, double altitude);
/**
- * Calculate the Earth's meridan radius of curvature at some latitude
+ * Calculate the Earth's meridian radius of curvature at some latitude
*
* @param latitude GPS latitude coordinate, in degrees
- * @return The meridan radius of curvature, in meters
+ * @return The meridian radius of curvature, in meters
*/
LIBTELLURIAN_CONST__
-double libtellurian_meridan_radius(double latitude);
+double libtellurian_meridian_radius(double latitude);
/**
- * Calculate the Earth's meridan radius of curvature at some latitude
+ * Calculate the Earth's meridian radius of curvature at some latitude
*
* @param latitude GPS latitude coordinate, in radians
- * @return The meridan radius of curvature, in meters
+ * @return The meridian radius of curvature, in meters
*/
LIBTELLURIAN_CONST__
-double libtellurian_meridan_radius_radians(double latitude);
+double libtellurian_meridian_radius_radians(double latitude);
/**
* Calculate the Earth's transverse radius of curvature at some latitude