Struct GradientSlopeCalculator
Object to cover the different types of Gradient and Slope calculations
Namespace: FpAssistantCore.GeneralAviation
Assembly: FpAssistantCoreScl.dll
Syntax
public struct GradientSlopeCalculator
Remarks
There are three components which are a horizontal distance, a vertical distance and a gradient.
Constructors
View SourceGradientSlopeCalculator(LinearDistanceUnits, LinearDistanceUnits)
Constructor to initalise with a specific value and unit type
Declaration
public GradientSlopeCalculator(LinearDistanceUnits horizontalDistanceUnit, LinearDistanceUnits verticalDistanceUnit)
Parameters
Type | Name | Description |
---|---|---|
LinearDistanceUnits | horizontalDistanceUnit | Declare the linear distance unit for the horizontal distant parameter |
LinearDistanceUnits | verticalDistanceUnit | Unit type of the vertical distance used in the calculations |
Properties
View SourceGradientPercentage
Contains the numerical value of the gradient percentage
Declaration
public double GradientPercentage { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Numerical value of the percentage |
HorizontalDistance
Contains the numerical value of the distance
Declaration
public LinearDistance HorizontalDistance { get; set; }
Property Value
Type | Description |
---|---|
LinearDistance | Numerical value of the distance |
SlopeDegrees
Contains the numerical value of the slope angle in degrees
Declaration
public readonly double SlopeDegrees { get; }
Property Value
Type | Description |
---|---|
System.Double | Numerical value of the slope (Degrees) |
VerticalDistance
Contains the numerical value of the change in elevation along the distance
Declaration
public LinearDistance VerticalDistance { get; set; }
Property Value
Type | Description |
---|---|
LinearDistance | Numerical value of the change in elevation |
Methods
View SourceCalculateDistance()
Declaration
public void CalculateDistance()
CalculateElevationChange()
Declaration
public void CalculateElevationChange()
CalculateGradient()
Declaration
public void CalculateGradient()
DistanceFromHeightAndPercentage(Double, Double)
Calculates a horizontal distance based on a known vertical distance and a percentage slope
Declaration
public static double DistanceFromHeightAndPercentage(double height, double percentage)
Parameters
Type | Name | Description |
---|---|---|
System.Double | height | vertical height gain |
System.Double | percentage | Percentage |
Returns
Type | Description |
---|---|
System.Double | Distance along the horizontal |
PercentageDistance(Double, Double)
Calculates a distance which is a percentage of another distance
Declaration
public static double PercentageDistance(double distance, double percentage)
Parameters
Type | Name | Description |
---|---|---|
System.Double | distance | Distance for percentage calculation |
System.Double | percentage | Percentage |
Returns
Type | Description |
---|---|
System.Double | Value of the percentage distance |
Examples
50% of 200 units is 100 units