Gravity and Gravitation Estimators

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Classes: NEDGravityEstimator, ECEFGravityEstimator, ECIGravitationEstimator (see the Class Reference table at the end of this page for Javadoc and source links).

Gravity vs. gravitation

Gravitation is the fundamental mass-attraction force; it does not include any centripetal effect. Gravity is what a body actually experiences at (or near) the Earth’s surface: the gravitational acceleration plus the (outward) centrifugal acceleration caused by the Earth’s rotation. An accelerometer never measures gravity or gravitation directly — it measures specific force, the non-gravitational force per unit mass, which is zero in freefall and equal and opposite to gravity when the body is held stationary:

Specific force is zero in freefall and equals m·gamma when stationary
flowchart LR A["Gravitation (gamma)\nmass attraction only"] --> C["Gravity (g)\ngamma minus centrifugal term"] B["Earth-rotation centrifugal\nacceleration"] --> C C -->|sensed via reaction| D["Specific force f\n(what accelerometers measure)"]

NEDGravityEstimator

Computes acceleration due to gravity resolved about the north, east, and down axes of the local navigation frame, for a given geodetic latitude and height, using the WGS84 Somigliana model for surface gravity plus first-order height corrections. East gravity is always zero by symmetry.

Surface gravity (Somigliana model):

North component (height correction due to the flattened, non-spherical Earth):

Down component (height and Earth-shape correction):

where is geodetic latitude, is height, is the WGS84 eccentricity, / are the WGS84 equatorial/polar radii, is the flattening, is the Earth rotation rate, and is the Earth gravitational constant. See [book-groves], §2.3.5.

double latitude = Math.toRadians(41.3851); // Barcelona, in radians
double height = 0.0; // meters

// static, stateless call - no need to instantiate the estimator
NEDGravity gravity = NEDGravityEstimator.estimateGravityAndReturnNew(latitude, height);

double gn = gravity.getGn(); // north component (m/s^2), typically near zero
double gd = gravity.getGd(); // down component (m/s^2), approximately 9.8

// an instance can be reused instead, if preferred
NEDGravityEstimator estimator = new NEDGravityEstimator();
NEDGravity result = new NEDGravity();
estimator.estimate(latitude, height, result);

ECEFGravityEstimator

Computes the same gravity vector, but resolved about ECEF-frame axes for a Cartesian position . The gravitational term uses a spherical-harmonic approximation truncated to the zonal term (Earth’s oblateness), and the centrifugal term is added explicitly since ECEF axes rotate with the Earth:



The last step adds the outward centrifugal acceleration to the gravitational acceleration, matching the general relation .

double x = 4_789_000.0; // ECEF position (m)
double y = 177_000.0;
double z = 4_195_000.0;

ECEFGravity gravity = ECEFGravityEstimator.estimateGravityAndReturnNew(x, y, z);

double gx = gravity.getGx();
double gy = gravity.getGy();
double gz = gravity.getGz();
double norm = gravity.getNorm(); // total gravity magnitude (m/s^2)

ECIGravitationEstimator

Computes gravitation only (no centrifugal term) resolved about ECI-frame axes, using the same spherical-harmonic model as ECEFGravityEstimator. Because the ECI frame is inertial (does not rotate with the Earth), there is no centrifugal acceleration to add — the ECI navigation equations add that term separately when needed via the Earth-rotation skew-symmetric matrix .

double x = 4_789_000.0; // ECI position at a given instant (m)
double y = 177_000.0;
double z = 4_195_000.0;

ECIGravitation gravitation = ECIGravitationEstimator.estimateGravitationAndReturnNew(x, y, z);

double gammaX = gravitation.getGx();
double gammaY = gravitation.getGy();
double gammaZ = gravitation.getGz();

Which one should I use?

Class Resolving frame Returns

NEDGravityEstimator

Local navigation (north, east, down)

Gravity g (gravitation + centrifugal)

ECEFGravityEstimator

ECEF (rotates with the Earth)

Gravity g (gravitation + centrifugal)

ECIGravitationEstimator

ECI (inertial)

Gravitation gamma only (no centrifugal term)

Class Reference

Javadoc and source links for the classes used in the examples above:

Class Javadoc Source

NEDGravityEstimator

Javadoc

Source

NEDGravity

Javadoc

Source

ECEFGravityEstimator

Javadoc

Source

ECEFGravity

Javadoc

Source

ECIGravitationEstimator

Javadoc

Source

ECIGravitation

Javadoc

Source

Where to go next