Table of Contents

Class GravityLibrary

Namespace
NominalSystems.Universe
Assembly
NominalSystems.Universe.dll

[Nominal] Static library for accessing gravity functions for some generic positions and forces of planets.


public static class GravityLibrary
Inheritance
GravityLibrary

Methods

GetAcceleration(Vector3, CelestialBody[], double)

Calculates the gravitational field vector at a particular location based on the position of the center of mass of the object and the time step, for Euler stepped position.

public static Vector3 GetAcceleration(Vector3 position, CelestialBody[] bodies, double step)

Parameters

position Vector3

[m] The position of the CoM of the object with reference to the frame it is stored in (r_cF_N)

bodies CelestialBody[]

[-] The list of celestial bodies in the simulation

step double

[s] The step time interval

Returns

Vector3

[m/s^2] The current gravity field vector

GetAcceleration(Vector3, SolarSystem, double)

Calculates the gravitational field vector at a particular location based on the position of the center of mass of the object and the time step, for Euler stepped position.

public static Vector3 GetAcceleration(Vector3 position, SolarSystem system, double step)

Parameters

position Vector3

[m] The position of the CoM of the object with reference to the frame it is stored in

system SolarSystem

[-] The solar system object

step double

[s] The step time interval

Returns

Vector3

[m/s^2] The current gravity field vector

GetAcceleration(Vector3, double)

Calculates the acceleration of a body at a given position due to the force of gravity by a single body (assuming a two-body solution).

public static Vector3 GetAcceleration(Vector3 position, double mu)

Parameters

position Vector3

[m] The position relative to the body origin

mu double

[-] The gravitation constant multiplied by the mass parameter

Returns

Vector3

[m/s^2] The acceleration of the body due to the planet

GetOrbitalEnergy(Vector3, CelestialBody[], double)

Calculates the orbital energy of the current position, which will compute the gravitation potential energy at a specific point in time at some position with a time-step.

public static double GetOrbitalEnergy(Vector3 position, CelestialBody[] bodies, double step)

Parameters

position Vector3

[m] The current position in reference to the center of mass in the inertial frame (r_cF_N)

bodies CelestialBody[]

[-] The list of celestial bodies in the simulation

step double

[s] The time step to calculate stepped position

Returns

double

[J] A reference to the current potential energy contributions

GetOrbitalEnergy(Vector3, SolarSystem, double)

Calculates the orbital energy of the current position, which will compute the gravitation potential energy at a specific point in time at some position with a time-step. This includes all celestial bodies within the current simulation.

public static double GetOrbitalEnergy(Vector3 position, SolarSystem system, double step)

Parameters

position Vector3

[m] The current position in reference to the center of mass in the inertial frame

system SolarSystem

[-] The solar system reference to get all celestial bodies from

step double

[s] The time step to calculate stepped position

Returns

double

[J] A reference to the current potential energy contributions