C# Class Trajectories.StockAeroUtil

Show file Open project: neuoy/KSPTrajectories Class Usage Examples

Public Methods

Method Description
GetDensity ( UnityEngine.Vector3d position, CelestialBody body ) : double
GetDensity ( double altitude, CelestialBody body ) : double

Gets the air density (rho) for the specified altitude on the specified body. This is an approximation, because actual calculations, taking sun exposure into account to compute air temperature, require to know the actual point on the body where the density is to be computed (knowing the altitude is not enough). However, the difference is small for high altitudes, so it makes very little difference for trajectory prediction.

GetTemperature ( UnityEngine.Vector3d position, CelestialBody body ) : double

This function should return exactly the same value as Vessel.atmDensity, but is more generic because you don't need an actual vessel updated by KSP to get a value at the desired location. Computations are performed for the current body position, which means it's theoritically wrong if you want to know the temperature in the future, but since body rotation is not used (position is given in sun frame), you should get accurate results up to a few weeks.

SimAeroForce ( Vessel _vessel, Vector3 v_wrld_vel, Vector3 position ) : Vector3
SimAeroForce ( Vessel _vessel, Vector3 v_wrld_vel, double altitude, double latitude = 0.0 ) : Vector3

Method Details

GetDensity() public static method

public static GetDensity ( UnityEngine.Vector3d position, CelestialBody body ) : double
position UnityEngine.Vector3d
body CelestialBody
return double

GetDensity() public static method

Gets the air density (rho) for the specified altitude on the specified body. This is an approximation, because actual calculations, taking sun exposure into account to compute air temperature, require to know the actual point on the body where the density is to be computed (knowing the altitude is not enough). However, the difference is small for high altitudes, so it makes very little difference for trajectory prediction.
public static GetDensity ( double altitude, CelestialBody body ) : double
altitude double Altitude above sea level (in meters)
body CelestialBody
return double

GetTemperature() public static method

This function should return exactly the same value as Vessel.atmDensity, but is more generic because you don't need an actual vessel updated by KSP to get a value at the desired location. Computations are performed for the current body position, which means it's theoritically wrong if you want to know the temperature in the future, but since body rotation is not used (position is given in sun frame), you should get accurate results up to a few weeks.
public static GetTemperature ( UnityEngine.Vector3d position, CelestialBody body ) : double
position UnityEngine.Vector3d
body CelestialBody
return double

SimAeroForce() public static method

public static SimAeroForce ( Vessel _vessel, Vector3 v_wrld_vel, Vector3 position ) : Vector3
_vessel Vessel
v_wrld_vel Vector3
position Vector3
return Vector3

SimAeroForce() public static method

public static SimAeroForce ( Vessel _vessel, Vector3 v_wrld_vel, double altitude, double latitude = 0.0 ) : Vector3
_vessel Vessel
v_wrld_vel Vector3
altitude double
latitude double
return Vector3