Gravitation functions.
More...
|
int | zsl_phy_grav_orb_period (zsl_real_t mp, zsl_real_t msat, zsl_real_t r, zsl_real_t *t) |
| Calculates the orbital period of a satelite orbiting another body in seconds based on the distance between the bodies (r) and their masses. More...
|
|
int | zsl_phy_grav_esc_vel (zsl_real_t mp, zsl_real_t r, zsl_real_t *v) |
| Calculates the velocity needed for an object to overcome the gravitational pull of the planet it is on in meters per second based on the mass (mp) and the radius (r) of the planet. More...
|
|
int | zsl_phy_grav_acc (zsl_real_t m, zsl_real_t r, zsl_real_t *a) |
| Calculates the gravitational acceleration at any point created by an object of mass 'm' in meters per second squared. More...
|
|
int | zsl_phy_grav_orb_vel (zsl_real_t mp, zsl_real_t r, zsl_real_t *v) |
| Calculates the velocity of an object moving about a planet describing a circular orbit in meters per second based on the mass of the planet (mp) and the radius (r) of the orbit. More...
|
|
int | zsl_phy_grav_force (zsl_real_t m1, zsl_real_t m2, zsl_real_t r, zsl_real_t *f) |
| Calculates the gravitational force between two objects in newtons based on their masses (m1 and m2) and the distance they are separeted (r). More...
|
|
int | zsl_phy_grav_pot_ener (zsl_real_t m1, zsl_real_t m2, zsl_real_t r, zsl_real_t *u) |
| Calculates the gravitational potential energy between two objects in kilojoules based on their masses (m1 and m2) and the distance they are separated (r). More...
|
|
Gravitation functions.
◆ zsl_phy_grav_acc()
Calculates the gravitational acceleration at any point created by an object of mass 'm' in meters per second squared.
- Parameters
-
m | Mass of the object in kilograms. |
r | Distance between the point and the object in meters. |
a | Pointer to the output acceleration in meters per second squared. Will be set to NAN if the distance is zero. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_grav_esc_vel()
Calculates the velocity needed for an object to overcome the gravitational pull of the planet it is on in meters per second based on the mass (mp) and the radius (r) of the planet.
- Parameters
-
mp | Mass of the planet in kilograms. |
r | Radius of the planet in meters. |
v | Pointer to the output escape velocity in meters per second. Will be set to NAN if the radius of the planet is zero. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_grav_force()
Calculates the gravitational force between two objects in newtons based on their masses (m1 and m2) and the distance they are separeted (r).
- Parameters
-
m1 | Mass of the first object in kilograms. |
m2 | Mass of the second object in kilograms. |
r | Distance between the objects in meters. |
f | Pointer to the output force in newtons. Will be set to NAN if the distance is zero. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_grav_orb_period()
Calculates the orbital period of a satelite orbiting another body in seconds based on the distance between the bodies (r) and their masses.
- Parameters
-
mp | Mass of the central body in kilograms. |
msat | Mass of the orbiting body in kilograms. |
r | Semimajor axis of the orbit in meters (if the orbit is circular, this will be equal to the radius of the orbit). |
t | Pointer to the output orbital period in seconds. Will be set to NAN if the sum of both masses is zero. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_grav_orb_vel()
Calculates the velocity of an object moving about a planet describing a circular orbit in meters per second based on the mass of the planet (mp) and the radius (r) of the orbit.
- Parameters
-
mp | Mass of the planet in kilograms. |
r | Radius of the orbit in meters. |
v | Pointer to the output velocity tangent to the orbit in meters per second. Will be set to NAN if the radius of the orbit is zero. |
- Returns
- 0 if everything executed properly, error code on failure.
◆ zsl_phy_grav_pot_ener()
Calculates the gravitational potential energy between two objects in kilojoules based on their masses (m1 and m2) and the distance they are separated (r).
- Parameters
-
m1 | Mass of the first object in kilograms. |
m2 | Mass of the second object in kilograms. |
r | Distance between the objects in meters. |
u | Pointer to the output potential energy in kilojoules. Will be set to NAN if the distance is zero. |
- Returns
- 0 if everything executed properly, error code on failure.