/// <summary> /// Evaluate the components of the acceleration due to gravity in geocentric coordinates. /// </summary> /// <param name="X">the <i>X</i> component of geocentric coordinate of point (meters).</param> /// <param name="Y">the <i>Y</i> component of geocentric coordinate of point (meters).</param> /// <param name="Z">the <i>Z</i> component of geocentric coordinate of point (meters).</param> /// <returns> /// <list type="bullet"> /// <item><i>V</i> = <i>W</i> - Φ, the gravitational potential (m^2 s^−2).</item> /// <item><i>GX</i>, the <i>X</i> component of the acceleration (m s^−2).</item> /// <item><i>GY</i>, the <i>Y</i> component of the acceleration (m s^−2).</item> /// <item><i>GZ</i>, the <i>Z</i> component of the acceleration (m s^−2).</item> /// </list> /// </returns> public (double V, double GX, double GY, double GZ) V(double X, double Y, double Z) { double Vres = _gravitational.Evaluate(X, Y, Z, out var GX, out var GY, out var GZ), f = _GMmodel / _amodel; Vres *= f; GX *= f; GY *= f; GZ *= f; return(Vres, GX, GY, GZ); }
/// <summary> /// Evaluate the geoid height. /// </summary> /// <param name="lat">the geographic latitude (degrees).</param> /// <param name="lon">the geographic longitude (degrees).</param> /// <returns><i>N</i>, the height of the geoid above the <see cref="ReferenceEllipsoid"/> (meters).</returns> /// <remarks> /// This calls <see cref="NormalGravity.U(double, double, double)"/> for /// <see cref="ReferenceEllipsoid"/>. Some approximations are made in computing the geoid height so that the results of /// the NGA codes are reproduced accurately. Details are given in /// <a href="https://geographiclib.sourceforge.io/html/gravity.html#gravitygeoid">Details of the geoid height and anomaly calculations</a>. /// </remarks> public double GeoidHeight(double lat, double lon) { var(X, Y, Z) = _earth.Earth.IntForward(lat, lon, 0); double gamma0 = _earth.SurfaceGravity(lat), T = InternalT(X, Y, Z, out _, out _, out _, false, false), invR = 1 / Hypot(Hypot(X, Y), Z), correction = _corrmult * _correction.Evaluate(invR * X, invR * Y, invR * Z); // _zeta0 has been included in _correction return(T / gamma0 + correction); }