Class GravityBody
- Namespace
- NominalSystems.Universe
- Assembly
- NominalSystems.Universe.dll
A gravity body has its position known from SPICE All gravity bodies have their own gravitational field and properties set directly from SPICE and the SPICE interface
public class GravityBody
- Inheritance
-
GravityBody
Constructors
GravityBody()
Main constructor to initialise the Gravity Body and set up the properties.
public GravityBody()
Fields
Atmosphere
The atmosphere of the body, if it exists
public Atmosphere Atmosphere
Field Value
BodyInformation
The body information structure storing data about the body
public BodyInformation BodyInformation
Field Value
GroundObjects
A list of all ground objects attached
public List<GroundObject> GroundObjects
Field Value
IsCentralBody
The central body flag
[EditableVariable("-", true, "", "")]
public bool IsCentralBody
Field Value
MagneticField
The magnetic field of the gravity body, if it exists
public MagneticField MagneticField
Field Value
Out_SpicePlanetStateMsg
The body message data
public SpicePlanetStateMessage Out_SpicePlanetStateMsg
Field Value
Transform
[-] The current transform (rotation and position) of the body
public Transform Transform
Field Value
Properties
AlbedoAverage
[-] Average Albedo of the Body
[EditableVariable("-", true, "", "")]
public double AlbedoAverage { get; }
Property Value
AtmosphereEnabled
[-] A flag whether the atmosphere is enabled
public bool AtmosphereEnabled { get; }
Property Value
Density
[kg m-3] Density of the body
[EditableVariable("kg m-3", true, "", "")]
public double Density { get; }
Property Value
Diameter
[m] Equatorial Diameter of the Body
[EditableVariable("m", true, "", "")]
public double Diameter { get; }
Property Value
J2
[-] The measure of the gravitaional effect of a planet due to its oblaqueness.
[EditableVariable("-", true, "", "")]
public double J2 { get; }
Property Value
MagneticFieldEnabled
[-] A flag whether the magnetic field is enabled
public bool MagneticFieldEnabled { get; }
Property Value
Mass
[kg] The mass of the gravity body / planet
[EditableVariable("kg", true, "", "")]
public double Mass { get; }
Property Value
Mu
[m3 s−2] Gravitational Mu of the body
[EditableVariable("m3 s−2", true, "", "")]
public double Mu { get; }
Property Value
Name
Name of the body
[EditableVariable("-", true, "", "")]
public string Name { get; }
Property Value
Omega
[r/s] Angular velocity of the rotation of the body
[EditableVariable("r/s", true, "", "")]
public double Omega { get; }
Property Value
OrbitSemiMajorAxis
[m] Semi Major Axis of the orbit around the sun or parented body
[EditableVariable("m", true, "", "")]
public double OrbitSemiMajorAxis { get; }
Property Value
PolarRadius
[m] Polar Radius of the Body
[EditableVariable("m", true, "", "")]
public double PolarRadius { get; }
Property Value
Position
[m] The Inertial Position of the Body relative to the Central Body from SPICE
[EditableVariable("m", true, "", "")]
public Vector3 Position { get; }
Property Value
Radius
[m] Equatorial Radius of the Body
[EditableVariable("m", true, "", "")]
public double Radius { get; }
Property Value
Rotation
[deg] The rotation of the body in pitch, roll, yaw
[EditableVariable("deg", true, "", "")]
public virtual Vector3 Rotation { get; set; }
Property Value
SphericalHarmonics
The spherical harmonics model
public SphericalHarmonics SphericalHarmonics { get; }
Property Value
Velocity
[m/s] The Inertial Velocity of the Body relative to the Central Body from SPICE
[EditableVariable("m/s", true, "", "")]
public Vector3 Velocity { get; }
Property Value
Methods
ComputeInertialGravity(Vector3, double)
Calculates the gravity from this body at some location.
public Vector3 ComputeInertialGravity(Vector3 inertialPosition, double step)
Parameters
inertialPosition
Vector3The inertial reference frame location of the object [m]
step
doubleThe time difference in step for spherical harmonics [s]
Returns
- Vector3
The gravitational force vector
ComputePotentialEnergy(Vector3)
Calculates the potential energy of the body at some location.
public double ComputePotentialEnergy(Vector3 inertialPosition)
Parameters
inertialPosition
Vector3The inertial reference frame location of the object [m]
Returns
- double
The gravitational energy [J]
InitialiseHarmonics(int)
Initialises the spherical harmonics of the gravity body
public void InitialiseHarmonics(int degree)
Parameters
degree
intThe degree of harmonics