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

Stores parameters to calculate a planet's temperature at an arbitrary altitude. The way the temperature is calculated is divided in intervals, which can have constant temperatures, linear functions, or quadratic functions. More...

Public Member Functions

bool AddConstantStep (float limit, float K)
 Used to add an extra constant interval. If this is the first interval, a minimum altitude of 0 will be considered, if limit is less than 0, a maximum altitude of 0 will be considered. More...
 
bool AddInitialConstantStep (float min, float max, float K)
 Used to add a constant interval as the initial one, providing equation coefficients More...
 
bool AddInitialLinearStep (float temp1, float alt1, float temp2, float alt2)
 Used to add a linear interval as the initial one, providing the interval's values More...
 
bool AddInitialLinearStepEquation (float min, float max, float m, float b)
 Used to add a linear interval as the initial one, providing rect parameters. More...
 
bool AddInitialQuadraticStep (float min, float max, float A, float B, float C)
 Used to add a quadratic interval as the initial one, providing equation coefficients More...
 
bool AddLinearStep (float limit, float temp2)
 Used to add an extra linear interval. If this is the first one, a minimum altitude of 0 will be considered, if limit is less than 0, a maximum altitude of 0 will be considered, the initial temperature in this case will be considered 0. More...
 
bool AddQuadraticStep (float limit, float A, float B, float C)
 Used to add an extra quadratic interval. If this is the first one, a minimum altitude of 0 will be considered, if limit is less than 0, a maximum altitude of 0 will be considered. More...
 
 TemperatureModel ()
 

Detailed Description

Stores parameters to calculate a planet's temperature at an arbitrary altitude. The way the temperature is calculated is divided in intervals, which can have constant temperatures, linear functions, or quadratic functions.

Usage: Create a temperature model, then add intervals to it, example:

TemperatureModel Earth = new TemperatureModel(); Earth.addInitialLinearInterval(15,0,-45,12); Earth.addLinearInterval(); Earth.addConstantInterval(); Earth.addLinearInterval();

Constructor & Destructor Documentation

TemperatureModel.TemperatureModel ( )
inline

Member Function Documentation

bool TemperatureModel.AddConstantStep ( float  limit,
float  K 
)
inline

Used to add an extra constant interval. If this is the first interval, a minimum altitude of 0 will be considered, if limit is less than 0, a maximum altitude of 0 will be considered.

Parameters
limitThe limit of this interval, it has to be bigger than all previous limits
KConstant temperature value
Returns
true if the interval was added correctly, false otherwise
bool TemperatureModel.AddInitialConstantStep ( float  min,
float  max,
float  K 
)
inline

Used to add a constant interval as the initial one, providing equation coefficients

Parameters
minlowest altitude in the interval
maxhighest altitude in the interval
KConstant temperature value
Returns
bool TemperatureModel.AddInitialLinearStep ( float  temp1,
float  alt1,
float  temp2,
float  alt2 
)
inline

Used to add a linear interval as the initial one, providing the interval's values

Parameters
temp1First temperature value
alt1First altitude value
temp2Second temperature value
alt2Second altitude value
Returns
true if the interval was added correctly, false otherwise
bool TemperatureModel.AddInitialLinearStepEquation ( float  min,
float  max,
float  m,
float  b 
)
inline

Used to add a linear interval as the initial one, providing rect parameters.

Parameters
minlowest altitude in the interval
maxgreatest altitude in the interval
mslope of the rect's equation
bb of the y = mx+b rect's equation
Returns
true if the interval was added correctly, false otherwise
bool TemperatureModel.AddInitialQuadraticStep ( float  min,
float  max,
float  A,
float  B,
float  C 
)
inline

Used to add a quadratic interval as the initial one, providing equation coefficients

Parameters
minlowest altitude in the interval
maxhighest altitude in the interval
A(A)x^2 + Bx + C
BAx^2 + (B)x + C
CAx^2 + Bx + (C)
Returns
bool TemperatureModel.AddLinearStep ( float  limit,
float  temp2 
)
inline

Used to add an extra linear interval. If this is the first one, a minimum altitude of 0 will be considered, if limit is less than 0, a maximum altitude of 0 will be considered, the initial temperature in this case will be considered 0.

Parameters
limitThe limit of this interval, it has to be bigger than all previous limits
temp2Temperature value at the limit
Returns
true if the interval was added correctly, false otherwise
bool TemperatureModel.AddQuadraticStep ( float  limit,
float  A,
float  B,
float  C 
)
inline

Used to add an extra quadratic interval. If this is the first one, a minimum altitude of 0 will be considered, if limit is less than 0, a maximum altitude of 0 will be considered.

Parameters
limitThe limit of this interval, it has to be bigger than all previous limits
AQuadratic coefficient of the equation y = Ax^2 + Bx + C
BLinear coefficient of the equation y = Ax^2 + Bx + C
CConstant coefficient of the equation y = Ax^2 + Bx + C
Returns

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