The potential energy owing to gravity is of the form given here, where
g
is the gravity vector in the inertial coordinate system.