Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Classes | Static Public Member Functions | List of all members
FinePrint.Utilities.OrbitUtilities Class Reference

Static Public Member Functions

static double AngleOfAscendingNode (Orbit currentOrbit, Orbit targetOrbit)
 Finds the angle of the ascending node between two orbits. More...
 
static double AngleOfDescendingNode (Orbit currentOrbit, Orbit targetOrbit)
 Finds the angle of the descending node between two orbits. More...
 
static Orbit GenerateOrbit (int seed, CelestialBody targetBody, OrbitType orbitType, double altitudeDifficulty, double inclinationDifficulty, double eccentricityOverride=0)
 Generates a random orbit. More...
 
static double GetRelativeInclination (Orbit a, Orbit b)
 Gets the relative inclination difference between two orbits. More...
 
static OrbitType IdentifyOrbit (Orbit o)
 Checks an orbit for characteristics of an orbit type. More...
 
static Vector3d PositionOfApoapsis (Orbit o)
 Gets the world position of an orbit's apoapsis. More...
 
static Vector3d PositionOfPeriapsis (Orbit o)
 Gets the world position of an orbit's periapsis. More...
 
static bool ValidateOrbit (int seed, ref Orbit orbit, OrbitType orbitType, double altitudeDifficulty, double inclinationDifficulty, string source="")
 Checks a generated orbit for awkward parameters, and patches it to sane ones. More...
 

Member Function Documentation

static double FinePrint.Utilities.OrbitUtilities.AngleOfAscendingNode ( Orbit  currentOrbit,
Orbit  targetOrbit 
)
inlinestatic

Finds the angle of the ascending node between two orbits.

Parameters
currentOrbitThe current orbit.
targetOrbitThe target orbit.
Returns
The true anomaly of the ascending node between both orbits.

< If the vector points to the infalling part of the orbit then we need to do 360 minus the angle from Pe to get the true anomaly.

static double FinePrint.Utilities.OrbitUtilities.AngleOfDescendingNode ( Orbit  currentOrbit,
Orbit  targetOrbit 
)
inlinestatic

Finds the angle of the descending node between two orbits.

Parameters
currentOrbitThe current orbit.
targetOrbitThe target orbit.
Returns
The true anomaly of the descending node between both orbits.
static Orbit FinePrint.Utilities.OrbitUtilities.GenerateOrbit ( int  seed,
CelestialBody  targetBody,
OrbitType  orbitType,
double  altitudeDifficulty,
double  inclinationDifficulty,
double  eccentricityOverride = 0 
)
inlinestatic

Generates a random orbit.

Parameters
seedThe seed to generate from.
targetBodyThe celestial body.
orbitTypeType of the orbit.
altitudeDifficultyHow drastic the apses can get.
inclinationDifficultyHow drastic the inclination can get.
eccentricityOverrideForce an eccentricity. (0-1)
Returns
A randomly generated orbit.
static double FinePrint.Utilities.OrbitUtilities.GetRelativeInclination ( Orbit  a,
Orbit  b 
)
inlinestatic

Gets the relative inclination difference between two orbits.

Parameters
aThe first orbit.
bThe other orbit.
Returns
Angular difference (0 to 180)
static OrbitType FinePrint.Utilities.OrbitUtilities.IdentifyOrbit ( Orbit  o)
inlinestatic

Checks an orbit for characteristics of an orbit type.

Parameters
oThe orbit.
Returns
The orbit's orbit type.
static Vector3d FinePrint.Utilities.OrbitUtilities.PositionOfApoapsis ( Orbit  o)
inlinestatic

Gets the world position of an orbit's apoapsis.

Parameters
oThe orbit.
Returns
A world position.
static Vector3d FinePrint.Utilities.OrbitUtilities.PositionOfPeriapsis ( Orbit  o)
inlinestatic

Gets the world position of an orbit's periapsis.

Parameters
oThe orbit.
Returns
A world position.
static bool FinePrint.Utilities.OrbitUtilities.ValidateOrbit ( int  seed,
ref Orbit  orbit,
OrbitType  orbitType,
double  altitudeDifficulty,
double  inclinationDifficulty,
string  source = "" 
)
inlinestatic

Checks a generated orbit for awkward parameters, and patches it to sane ones.

Parameters
seedThe seed to generate parameters from.
orbitThe orbit reference to patch.
orbitTypeType of the orbit.
altitudeDifficultyHow drastic the apses can get.
inclinationDifficultyHow drastic the inclination can get.
Returns
If the orbit was sane to begin with.

< We could check for many more things one day: null referenceBody, eccentricity over one, apoapsis out of sphere of influence, etc.

< However, for now, let's stick with pure NaNs and infinities, things that can cause the orbit to actually disappear.


The documentation for this class was generated from the following file: