Show / Hide Table of Contents

Struct GradientSlopeCalculator

Object to cover the different types of Gradient and Slope calculations

Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
ValueType.ToString()
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
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 Source

GradientSlopeCalculator(LinearDistanceUnits, LinearDistanceUnits)

Constructor to initialise 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 Source

GradientPercentage

Contains the numerical value of the gradient percentage

Declaration
public double GradientPercentage { get; set; }
Property Value
Type Description
double

Numerical value of the percentage

View Source

HorizontalDistance

Contains the numerical value of the distance

Declaration
public LinearDistance HorizontalDistance { get; set; }
Property Value
Type Description
LinearDistance

Numerical value of the distance

View Source

SlopeDegrees

Contains the numerical value of the slope angle in degrees

Declaration
public double SlopeDegrees { get; }
Property Value
Type Description
double

Numerical value of the slope (Degrees)

View Source

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 Source

CalculateDistance()

Declaration
public void CalculateDistance()
View Source

CalculateElevationChange()

Declaration
public void CalculateElevationChange()
Exceptions
Type Condition
ArgumentOutOfRangeException

Gradient percentage or Distance value must be greater than 0.0

View Source

CalculateGradient()

Declaration
public void CalculateGradient()
Exceptions
Type Condition
ArgumentOutOfRangeException

Distance value must be greater than 0.0

View Source

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
double height

vertical height gain

double percentage

Percentage

Returns
Type Description
double

Distance along the horizontal

Exceptions
Type Condition
ArgumentOutOfRangeException

Percentage must be greater than 0 and not greater than 100

View Source

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
double distance

Distance for percentage calculation

double percentage

Percentage

Returns
Type Description
double

Value of the percentage distance

Examples

50% of 200 units is 100 units

Exceptions
Type Condition
ArgumentOutOfRangeException

Percentage must be greater than 0 and not greater than 100

  • View Source
In this article
Back to top Copyright 2018-2025 CADology Limited