Gravity Engine 12.0
Unity Asset for Gravity
Loading...
Searching...
No Matches
NUtils Class Reference

Static Public Member Functions

static double GetEnergy (int numBodies, ref double[] m, ref double[,] r, ref double[,] v)
 Calculate the energy of the system Used internally by GravityEngine. Use GravityEngine.GetEnergy() from developer scripts.
 
static double GetEnergy (int numBodies, GravityState.NbodyState[] nb)
 
static float GaussianValue (float mean, float stdDev)
 
static float DegreesMod360 (float angle)
 Degress modules 360f (angle in 0..360)
 
static double DegreesMod360 (double angle)
 Degress modules 360f (angle in 0..360)
 
static float DegreesPM180 (float angle)
 Normalize degrees to +/- 180. Typically used for orbital inclination.
 
static double AngleMod2Pi (double angle)
 Ensure angle in radians is in (0, 2 Pi)
 
static bool VectorNaN (Vector3 v)
 Check if the vector has any NaN components.
 
static bool Array1DNaN (double[] a)
 Check if the vector has any NaN components.
 
static float AngleFullCircleRadians (Vector3 from, Vector3 to, Vector3 normal)
 
static double AngleFullCircleRadians (Vector3d from, Vector3d to, Vector3d normal)
 
static double AngleDeltaDegrees (double from, double to)
 Find counter-clockwise angle between from and to. e.g. 359 to 1 = 2 1 to 359 = 358.
 
static double AngleDeltaRadians (double from, double to)
 
static bool FloatEqualMod360 (float a_, float b_, double error)
 

Member Function Documentation

◆ AngleDeltaDegrees()

static double NUtils.AngleDeltaDegrees ( double  from,
double  to 
)
static

Find counter-clockwise angle between from and to. e.g. 359 to 1 = 2 1 to 359 = 358.

Parameters
from
to
Returns

◆ AngleMod2Pi()

static double NUtils.AngleMod2Pi ( double  angle)
static

Ensure angle in radians is in (0, 2 Pi)

Parameters
angle
Returns

◆ Array1DNaN()

static bool NUtils.Array1DNaN ( double[]  a)
static

Check if the vector has any NaN components.

Parameters
v
Returns

◆ DegreesMod360() [1/2]

static double NUtils.DegreesMod360 ( double  angle)
static

Degress modules 360f (angle in 0..360)

Returns
The mod360.
Parameters
angleAngle.

◆ DegreesMod360() [2/2]

static float NUtils.DegreesMod360 ( float  angle)
static

Degress modules 360f (angle in 0..360)

Returns
The mod360.
Parameters
angleAngle.

◆ DegreesPM180()

static float NUtils.DegreesPM180 ( float  angle)
static

Normalize degrees to +/- 180. Typically used for orbital inclination.

Parameters
angle
Returns

◆ GetEnergy()

static double NUtils.GetEnergy ( int  numBodies,
ref double[]  m,
ref double  r[,],
ref double  v[,] 
)
static

Calculate the energy of the system Used internally by GravityEngine. Use GravityEngine.GetEnergy() from developer scripts.

Returns
The energy.
Parameters
numBodiesNumber bodies.
mM.
rThe red component.
vV.

◆ VectorNaN()

static bool NUtils.VectorNaN ( Vector3  v)
static

Check if the vector has any NaN components.

Parameters
v
Returns

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