Gravity Engine 2 3.0
Loading...
Searching...
No Matches
GravityEngine2.GravityMath Class Reference

Public Types

enum  AxisV3 { X_AXIS , Y_AXIS , Z_AXIS }
 

Static Public Member Functions

static double Acosh (double x)
 
static double Angle (double3 from, double3 to)
 
static double AngleDeg (double3 from, double3 to)
 
static double AngleDeltaDegreesCW (double from, double to)
 
static double AngleDeltaRadianCW (double from, double to)
 
static double3 ApplyMatrix (ref double3x3 m, double3 v)
 
static double Asinh (double x)
 
static Vector3 Axis (AxisV3 axis)
 
static double Cot (double x)
 Cotangent function.
 
static void Double3ExchangeYZ (ref double3 v)
 
static void Double3IntoVector3 (double3 r, ref Vector3 v3)
 Convert a double3 and fill in values in an existing Vector3 (avoids a new() )
 
static Vector3 Double3ToVector3 (double3 r)
 Create a Vector3 holding the values of a double3.
 
static bool Equal (double3 a, double3 b, double tol)
 
static bool EqualRelError (double a, double b, double relError)
 
static bool EqualRelError (double3 a, double3 b, double relError)
 
static bool Equals (double3 a, double3 b, double within)
 
static bool HasNaN (double3 v)
 
static bool HasNaN (Vector3 v)
 
static double3 LatLongToR (double latitudeDeg, double longitudeDeg, double radius)
 Convert latitude, longitude and radius to a vector.
 
static double3 Matrix3x3TimesVector (double3x3 m, double3 v)
 
static double MinAngleDeltaDegrees (double from, double to)
 
static double MinAngleDeltaRadians (double from, double to)
 
static double3 Rot1 (double3 v, double angleRad)
 Return the rotation of the vector v by angleRad radians around the x axis.
 
static double3 Rot1Y (double3 v, double angleRad)
 
static double3 Rot1Z (double3 v, double angleRad)
 
static double3 Rot3 (double3 v, double angleRad)
 Return the rotation of the vector v by angleRad radians around the z axis.
 
static double3 Rot3CW (double3 v, double angleRad)
 Return rotation of vector by angleRad around Z in a clockwise (CW) direction.
 
static void Vector3ExchangeYZ (ref Vector3 v)
 
static void Vector3IntoDouble3 (Vector3 r, ref double3 d3)
 
static double3 Vector3ToDouble3 (Vector3 r)
 

Static Public Attributes

static readonly double DEG2RAD = System.Math.PI / 180.0
 
static readonly double RAD2DEG = 180.0 / System.Math.PI
 
static readonly double TWO_PI = 2.0 * Math.PI
 
static readonly Vector3 xAxis = Vector3.right
 
static readonly Vector3 yAxis = Vector3.up
 
static readonly Vector3 zAxis = Vector3.forward
 

Member Function Documentation

◆ Cot()

static double GravityEngine2.GravityMath.Cot ( double x)
static

Cotangent function.

Adapted from Vallado's astmath CPP functions.

◆ Double3IntoVector3()

static void GravityEngine2.GravityMath.Double3IntoVector3 ( double3 r,
ref Vector3 v3 )
static

Convert a double3 and fill in values in an existing Vector3 (avoids a new() )

Parameters
r
v3

◆ Double3ToVector3()

static Vector3 GravityEngine2.GravityMath.Double3ToVector3 ( double3 r)
static

Create a Vector3 holding the values of a double3.

Parameters
r
Returns

◆ LatLongToR()

static double3 GravityEngine2.GravityMath.LatLongToR ( double latitudeDeg,
double longitudeDeg,
double radius )
static

Convert latitude, longitude and radius to a vector.

This has the XY plane as the equator (standard right-handed physics spherical coordinates)

If want display XZ orbital plane will need to flip YZ with one of the '*ExchangeYZ' methods above.

Parameters
latitudeassume North is positive
longitudeassume east is positive
radius
Returns

◆ Rot1()

static double3 GravityEngine2.GravityMath.Rot1 ( double3 v,
double angleRad )
static

Return the rotation of the vector v by angleRad radians around the x axis.

Parameters
v
angleRad
Returns

◆ Rot3()

static double3 GravityEngine2.GravityMath.Rot3 ( double3 v,
double angleRad )
static

Return the rotation of the vector v by angleRad radians around the z axis.

Parameters
v
angleRad
Returns

◆ Rot3CW()

static double3 GravityEngine2.GravityMath.Rot3CW ( double3 v,
double angleRad )
static

Return rotation of vector by angleRad around Z in a clockwise (CW) direction.

Parameters
v
angleRad
Returns

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