Skip to main content

Class: CourseToAltitudeLegCalculator

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:329

Calculates flight path vectors for course to altitude legs.

Extends​

Constructors​

Constructor​

new CourseToAltitudeLegCalculator(facilityCache): CourseToAltitudeLegCalculator

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:338

Creates a new instance of CourseToAltitudeLegCalculator.

Parameters​

ParameterTypeDescription
facilityCacheFlightPathCalculatorFacilityCacheThis calculator's cache of facilities.

Returns​

CourseToAltitudeLegCalculator

Overrides​

AltitudeLegCalculator.constructor

Properties​

canSkipWhenActive​

protected readonly canSkipWhenActive: boolean

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:29

Whether this calculator can skip leg calculations when the leg to calculate is the active flight plan leg.

Inherited from​

AltitudeLegCalculator.canSkipWhenActive


circleVectorBuilder​

protected readonly circleVectorBuilder: CircleVectorBuilder

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:33

Inherited from​

AltitudeLegCalculator.circleVectorBuilder


facilityCache​

protected readonly facilityCache: FlightPathCalculatorFacilityCache

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:28

This calculator's cache of facilities.

Inherited from​

AltitudeLegCalculator.facilityCache


interceptCircleToPointVectorBuilder​

protected readonly interceptCircleToPointVectorBuilder: InterceptCircleToPointVectorBuilder

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:35

Inherited from​

AltitudeLegCalculator.interceptCircleToPointVectorBuilder


procTurnVectorBuilder​

protected readonly procTurnVectorBuilder: ProcedureTurnVectorBuilder

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:34

Inherited from​

AltitudeLegCalculator.procTurnVectorBuilder

Methods​

buildDistanceToAltitudeVector()​

protected buildDistanceToAltitudeVector(vectors, index, legIndex, leg, isActiveLeg, state, options, path, start, flags, heading, isHeadingTrue): number

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:64

Builds a flight path vector representing the path the airplane must fly to climb to the target altitude of a flight plan leg.

Parameters​

ParameterTypeDefault valueDescription
vectorsFlightPathVector[]undefinedThe flight path vector array to which to add the vector.
indexnumberundefinedThe index in the array at which to add the vector.
legIndexnumberundefinedThe index of the flight plan leg for which the vector is to be built.
legLegDefinitionundefinedThe flight plan leg for which the vector is to be built.
isActiveLegbooleanundefinedWhether the vector is to be built for the active flight plan leg.
stateFlightPathStateundefinedThe current flight path state.
optionsReadonly<FlightPathLegCalculationOptions>undefinedOptions to use for the leg calculations.
pathGeoCircleundefinedA GeoCircle that defines the path of the vector to build.
startReadonlyFloat64ArrayundefinedThe start point of the vector to build.
flagsnumberundefinedThe flags to set on the vector.
headingnumber | nullnullThe heading-to-fly to assign to the vector, in degrees, or null if no heading is to be assigned. Defaults to null.
isHeadingTruebooleanfalseWhether the heading-to-fly assigned to the vector is relative to true north instead of magnetic north. Defaults to false.

Returns​

number

The number of vectors that were built and added to the array.

Inherited from​

AltitudeLegCalculator.buildDistanceToAltitudeVector


buildFallbackVectorsToInterceptPath()​

protected buildFallbackVectorsToInterceptPath(vectors, index, legIndex, isActiveLeg, state, options, pathToInterceptCourse, path, origin, requireJoinCourse): number

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:128

Builds a sequence of flight path vectors representing a path that intercepts a desired great-circle path. The intercept path begins at the flight path state's current position and course. If an intercept path can be calculated, then it is guaranteed to end at or past a specified origin point along the path to intercept. If an intercept path cannot be calculated, then vectors will be built that represent a constant-radius turn toward the path to intercept's initial course.

Parameters​

ParameterTypeDescription
vectorsFlightPathVector[]The flight path vector array to which to add the vectors.
indexnumberThe index in the array at which to add the vectors.
legIndexnumberThe leg index to calculate
isActiveLegbooleanWhether the vectors are to be built for the active flight plan leg.
stateFlightPathStateThe current flight path state. If an intercept is successfully calculated, then the state's fallback flag will be set to false. If an intercept could not be calculated, then the fallback flag will not be changed.
optionsReadonly<FlightPathLegCalculationOptions>Options to use for the leg calculations.
pathToInterceptCoursenumberThe initial true course of the path to intercept, in degrees.
pathGeoCircleA GeoCircle that defines the path to intercept. If an intercept cannot be calculated, then the circle will be changed to the great-circle that defines the course along which the last calculated fallback vector ends.
originFloat64ArrayThe origin point of the path to intercept. The point will be changed, if necessary, to the point at which the built vectors actually intercept the path if the vectors intercept the path past the original origin point (as measured along the path to intercept).
requireJoinCoursebooleanWhether the path to build must join (i.e. end parallel to) the desired great-circle path to intercept.

Returns​

number

The number of vectors that were built and added to the array.

Inherited from​

AltitudeLegCalculator.buildFallbackVectorsToInterceptPath


calculate()​

calculate(legs, calculateIndex, activeLegIndex, state, options): LegCalculations

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:223

Calculates flight path vectors for a flight plan leg and adds the calculations to the leg.

Parameters​

ParameterTypeDescription
legsLegDefinition[]A sequence of flight plan legs.
calculateIndexnumberThe index of the leg to calculate.
activeLegIndexnumberThe index of the active leg.
stateFlightPathStateThe current flight path state.
optionsReadonly<FlightPathLegCalculationOptions>Options to use for the calculation.

Returns​

LegCalculations

The flight plan leg calculations.

Inherited from​

AltitudeLegCalculator.calculate


calculateMagVar()​

protected calculateMagVar(legs, calculateIndex, activeLegIndex, state): void

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:343

Calculates the magnetic variation for a flight plan leg.

Parameters​

ParameterTypeDescription
legsLegDefinition[]A sequence of flight plan legs.
calculateIndexnumberThe index of the leg to calculate.
activeLegIndexnumberThe index of the active leg.
stateFlightPathStateThe current flight path state.

Returns​

void

The number of vectors added to the sequence.

Overrides​

AltitudeLegCalculator.calculateMagVar


calculateVectors()​

protected calculateVectors(legs, calculateIndex, activeLegIndex, state, options): void

Defined in: src/sdk/flightplan/flightpath/legcalculators/AltitudeLegCalculator.ts:360

Calculates flight path vectors for a flight plan leg.

Parameters​

ParameterTypeDescription
legsLegDefinition[]A sequence of flight plan legs.
calculateIndexnumberThe index of the leg to calculate.
activeLegIndexnumberThe index of the active leg.
stateFlightPathStateThe current flight path state.
optionsReadonly<FlightPathLegCalculationOptions>Options to use for the leg calculations.

Returns​

void

The number of vectors added to the sequence.

Overrides​

AltitudeLegCalculator.calculateVectors


getLegMagVar()​

Call Signature​

protected getLegMagVar(leg): number | undefined

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:134

Gets the magnetic variation, in degrees, to use when calculating a flight plan leg's course. If the leg defines an origin or fix VOR facility, then the database magnetic variation defined for the VOR is used (the origin facility takes priority).

Parameters​
ParameterTypeDescription
legFlightPlanLegA flight plan leg.
Returns​

number | undefined

The magnetic variation, in degrees, to use when calculating the specified flight plan leg's course, or undefined if the leg does not define an origin or fix VOR facility.

Inherited from​

AltitudeLegCalculator.getLegMagVar

Call Signature​

protected getLegMagVar(leg, defaultPoint): number

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:143

Gets the magnetic variation, in degrees, to use when calculating a flight plan leg's course. If the leg defines an origin or fix VOR facility, then the database magnetic variation defined for the VOR is used (the origin facility takes priority). Otherwise, the model magnetic variation for the specified point is used.

Parameters​
ParameterTypeDescription
legFlightPlanLegA flight plan leg.
defaultPointLatLonInterfaceThe location from which to get magnetic variation if an origin or fix VOR is not found.
Returns​

number

The magnetic variation, in degrees, to use when calculating the specified flight plan leg's course.

Inherited from​

AltitudeLegCalculator.getLegMagVar

Call Signature​

protected getLegMagVar(leg, defaultPoint?): number | undefined

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:153

Gets the magnetic variation, in degrees, to use when calculating a flight plan leg's course. If the leg defines an origin or fix VOR facility, then the database magnetic variation defined for the VOR is used (the origin facility takes priority). Otherwise, the model magnetic variation for the specified point, if defined, is used.

Parameters​
ParameterTypeDescription
legFlightPlanLegA flight plan leg.
defaultPoint?LatLonInterfaceThe location from which to get magnetic variation if an origin or fix VOR is not found.
Returns​

number | undefined

The magnetic variation, in degrees, to use when calculating the specified flight plan leg's course, or undefined if the leg does not define an origin or fix VOR facility and a default point was not provided.

Inherited from​

AltitudeLegCalculator.getLegMagVar


getLegTrueCourse()​

protected getLegTrueCourse(leg): number | undefined

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:175

Gets the true course, in degrees, for a flight plan leg. If the leg defines an origin or fix VOR facility, then the magnetic variation defined at the VOR is used to adjust magnetic course. Otherwise the computed magnetic variation for the specified point is used.

Parameters​

ParameterTypeDescription
legFlightPlanLegA flight plan leg.

Returns​

number | undefined

The true course, in degrees, for the flight plan leg.

Inherited from​

AltitudeLegCalculator.getLegTrueCourse


getMagVarFromIcao()​

protected getMagVarFromIcao(icao): number | undefined

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:52

Gets the magnetic variation, in degrees, at a facility. If the facility is a VOR and it has a nominal database magnetic variation, then that value will be returned. Otherwise, the model magnetic variation at the facility's position will be returned.

Parameters​

ParameterTypeDescription
icaoIcaoValueThe ICAO value of the facility.

Returns​

number | undefined

The magnetic variation, in degrees, at the specified facility, or undefined if the specified facility could not be retrieved.

Inherited from​

AltitudeLegCalculator.getMagVarFromIcao


getPositionFromIcao()​

protected getPositionFromIcao(icao, out): GeoPoint | undefined

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:39

Gets a geographical position from an ICAO value.

Parameters​

ParameterTypeDescription
icaoIcaoValueAn ICAO value.
outGeoPointA GeoPoint object to which to write the result.

Returns​

GeoPoint | undefined

The geographical position corresponding to the ICAO string, or undefined if one could not be obtained.

Inherited from​

AltitudeLegCalculator.getPositionFromIcao


getTerminatorMagVar()​

protected getTerminatorMagVar(leg): number | undefined

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:118

Gets the magnetic variation, in degrees, at a flight plan leg's terminator fix. If the fix is a VOR and it has a nominal database magnetic variation, then that value will be returned. Otherwise, the model magnetic variation at the fix's position will be returned.

Parameters​

ParameterTypeDescription
legFlightPlanLegA flight plan leg.

Returns​

number | undefined

The magnetic variation, in degrees, at the specified flight plan leg's terminator fix, or undefined if the magnetic variation could not be determined.

Inherited from​

AltitudeLegCalculator.getTerminatorMagVar


getTerminatorPosition()​

protected getTerminatorPosition(leg, out, icao?): GeoPoint | undefined

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:75

Gets the geographic position for a flight plan leg terminator.

Parameters​

ParameterTypeDescription
legFlightPlanLegA flight plan leg.
outGeoPointA GeoPoint object to which to write the result.
icao?IcaoValueThe ICAO value of the leg's terminator fix. If not defined, then the terminator fix will be retrieved from the flight plan leg, if necessary.

Returns​

GeoPoint | undefined

The position of the leg terminator, or undefined if it could not be determined.

Inherited from​

AltitudeLegCalculator.getTerminatorPosition


resolveIngressToEgress()​

protected resolveIngressToEgress(legCalc): void

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:392

Calculates the ingress to egress vectors for a flight plan leg and adds them to a leg calculation.

Parameters​

ParameterTypeDescription
legCalcLegCalculationsThe calculations for a flight plan leg.

Returns​

void

Inherited from​

AltitudeLegCalculator.resolveIngressToEgress


shouldSkipWhenActive()​

protected shouldSkipWhenActive(legs, calculateIndex, activeLegIndex, state, options): boolean

Defined in: src/sdk/flightplan/flightpath/legcalculators/AbstractFlightPathLegCalculator.ts:341

Checks whether vector calculations should be skipped when the leg to calculate is the active leg.

Parameters​

ParameterTypeDescription
legsLegDefinition[]A sequence of flight plan legs.
calculateIndexnumberThe index of the leg to calculate.
activeLegIndexnumberThe index of the active leg.
stateFlightPathStateThe current flight path state.
optionsReadonly<FlightPathLegCalculationOptions>Options to use for the leg calculations.

Returns​

boolean

Whether to skip vector calculations.

Inherited from​

AltitudeLegCalculator.shouldSkipWhenActive