Class: FlightPathUtils
Utility class for working with flight path calculations.
Constructors
constructor
• new FlightPathUtils(): FlightPathUtils
Returns
Methods
createEmptyCircleVector
▸ createEmptyCircleVector(): CircleVector
Creates an empty arc vector.
Returns
An empty arc vector.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:18
getAlongArcNormalizedDistance
▸ getAlongArcNormalizedDistance(circle
, start
, end
, pos
, tolerance?
): number
Gets the normalized distance along an arc from a defined start point to a query point. The start, query, and end points will be projected onto the arc's parent circle if they do not already lie on it. The distance is normalized such that 1 equals the arc length from the start point to the end point. A negative distance indicates that the query point lies somewhere before the start of the arc but after the point on the arc's parent circle that is diametrically opposed to the midpoint of the arc.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
circle | GeoCircle | undefined | The arc's parent circle. |
start | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | undefined | The start point of the arc. |
end | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | undefined | The end point of the arc. |
pos | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | undefined | The query point. |
tolerance | number | GeoCircle.ANGULAR_TOLERANCE | The error tolerance, in great-arc radians, when checking if start and query are equal. Defaults to GeoCircle.ANGULAR_TOLERANCE if not specified. |
Returns
number
The normalized distance along the arc from the start point to the query point.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:358
getAlongArcSignedDistance
▸ getAlongArcSignedDistance(circle
, start
, end
, pos
, tolerance?
): number
Gets the signed distance along an arc from a defined start point to a query point. The start, query, and end points will be projected onto the arc's parent circle if they do not already lie on it. A negative distance indicates that the query point lies somewhere before the start of the arc but after the point on the arc's parent circle that is diametrically opposed to the midpoint of the arc.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
circle | GeoCircle | undefined | The arc's parent circle. |
start | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | undefined | The start point of the arc. |
end | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | undefined | The end point of the arc. |
pos | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | undefined | The query point. |
tolerance | number | GeoCircle.ANGULAR_TOLERANCE | The error tolerance, in great-arc radians, when checking if start and query are equal. Defaults to GeoCircle.ANGULAR_TOLERANCE if not specified. |
Returns
number
The signed distance along the arc from the start point to the query point, in great-arc radians.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:326
getGreatCircleTangentToPath
▸ getGreatCircleTangentToPath(point
, path
, out
): GeoCircle
Gets the great circle tangent to a given path at a given tangent point. The tangent circle will contain the tangent point and have the same direction as the path at the tangent point.
Parameters
Name | Type | Description |
---|---|---|
point | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The tangent point. If the point does not lie on the path, it will be projected onto the path. |
path | GeoCircle | The geo circle describing the path. |
out | GeoCircle | A GeoCircle object to which to write the result. |
Returns
The great circle tangent to the specified path at the specified point.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:247
getGreatCircleTangentToVector
▸ getGreatCircleTangentToVector(point
, vector
, out
): GeoCircle
Gets the great circle tangent to a given flight path vector at a given tangent point. The tangent circle will contain the tangent point and have the same direction as the vector at the tangent point.
Parameters
Name | Type | Description |
---|---|---|
point | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The tangent point. If the point does not lie on the vector, it will be projected onto the vector. |
vector | CircleVector | The flight path vector. |
out | GeoCircle | A GeoCircle object to which to write the result. |
Returns
The great circle tangent to the specified flight path vector at the specified point.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:268
getLegFinalCourse
▸ getLegFinalCourse(legCalc
): undefined
| number
Gets the final true course of a calculated leg.
Parameters
Name | Type | Description |
---|---|---|
legCalc | LegCalculations | A set of leg calculations. |
Returns
undefined
| number
The final true course of the leg, or undefined
if one could not be obtained.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:168
getLegFinalPosition
▸ getLegFinalPosition(legCalc
, out
): undefined
| GeoPoint
Gets the final position of a calculated leg.
Parameters
Name | Type | Description |
---|---|---|
legCalc | LegCalculations | A set of leg calculations. |
out | GeoPoint | The GeoPoint object to which to write the result. |
Returns
undefined
| GeoPoint
The final position of the leg, or undefined
if one could not be obtained.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:155
getLegTrueCourse
▸ getLegTrueCourse(leg
, point
, magVarFacility?
): number
Gets the true course for a flight plan leg.
Parameters
Name | Type | Description |
---|---|---|
leg | FlightPlanLeg | A flight plan leg. |
point | LatLonInterface | The location from which to get magnetic variation if magVarFacility is not defined. |
magVarFacility? | VorFacility | The VOR facility which defines the magnetic variation used for the leg's course. |
Returns
number
The true course for the specified flight plan leg.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:137
getTurnCenterFromCircle
▸ getTurnCenterFromCircle<T
>(circle
, out
): T
Gets the center of a turn described by a circle.
Type parameters
Name | Type |
---|---|
T | extends Float64Array | GeoPoint |
Parameters
Name | Type | Description |
---|---|---|
circle | GeoCircle | The geo circle describing the turn. |
out | T | A GeoPoint or 3D vector object to which to write the result. |
Returns
T
The center of a turn described by the circle.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:227
getTurnCircle
▸ getTurnCircle(center
, radius
, turnDirection
, out
): GeoCircle
Gets the circle describing the path of a turn.
Parameters
Name | Type | Description |
---|---|---|
center | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The center of the turn. |
radius | number | The radius of the turn, in great-arc radians. |
turnDirection | VectorTurnDirection | The direction of the turn. |
out | GeoCircle | A GeoCircle object to which to write the result. |
Returns
The circle describing the path of the turn.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:185
getTurnCircleStartingFromPath
▸ getTurnCircleStartingFromPath(start
, path
, turnRadius
, turnDirection
, out
): GeoCircle
Calculates and returns a circle describing a turn starting from a path at a specified point.
Parameters
Name | Type | Description |
---|---|---|
start | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The starting point of the turn. |
path | GeoCircle | The circle describing the path from which the turn starts. |
turnRadius | number | The radius of the turn, in great-arc radians. |
turnDirection | VectorTurnDirection | The direction of the turn. |
out | GeoCircle | A GeoCircle object to which to write the result. |
Returns
The circle describing the path of the specified turn.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:291
getTurnDirectionFromCircle
▸ getTurnDirectionFromCircle(circle
): VectorTurnDirection
Gets the direction of a turn described by a circle.
Parameters
Name | Type | Description |
---|---|---|
circle | GeoCircle | The geo circle describing the turn. |
Returns
The direction of the turn described by the circle.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:208
getTurnRadiusFromCircle
▸ getTurnRadiusFromCircle(circle
): number
Gets the radius of a turn described by a circle.
Parameters
Name | Type | Description |
---|---|---|
circle | GeoCircle | The geo circle describing the turn. |
Returns
number
The radius of the turn described by the circle, in great-arc radians.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:217
getVectorFinalCourse
▸ getVectorFinalCourse(vector
): number
Gets the final true course bearing of a flight path vector.
Parameters
Name | Type | Description |
---|---|---|
vector | CircleVector | A flight path vector. |
Returns
number
The final true course bearing of the vector, or undefined
if one could not be calculated.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:123
getVectorInitialCourse
▸ getVectorInitialCourse(vector
): number
Gets the initial true course bearing of a flight path vector.
Parameters
Name | Type | Description |
---|---|---|
vector | CircleVector | A flight path vector. |
Returns
number
The initial true course bearing of the vector, or undefined if one could not be calculated.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:111
getVectorTurnDirection
▸ getVectorTurnDirection(vector
): VectorTurnDirection
Gets the direction of a turn described by a flight path circle vector.
Parameters
Name | Type | Description |
---|---|---|
vector | CircleVector | The flight path circle vector describing the turn. |
Returns
The direction of the turn described by the flight path circle vector.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:93
getVectorTurnRadius
▸ getVectorTurnRadius(vector
): number
Gets the radius of a turn described by a flight path circle vector.
Parameters
Name | Type | Description |
---|---|---|
vector | CircleVector | The flight path circle vector describing the turn. |
Returns
number
The radius of the turn described by the flight path circle vector, in great-arc radians.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:102
isPointAlongArc
▸ isPointAlongArc(circle
, start
, end
, pos
, inclusive?
, tolerance?
): boolean
Checks if a point lies between the start and end points of an arc along a geo circle. The start, end, and query points will be projected onto the arc's parent circle if they do not already lie on it.
Parameters
Name | Type | Description |
---|---|---|
circle | GeoCircle | The arc's parent circle. |
start | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The start point of the arc. |
end | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The end point of the arc. |
pos | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The query point. |
inclusive? | boolean | Whether the arc includes the start and end points. Defaults to true . |
tolerance? | number | The error tolerance, in great-arc radians. Defaults to GeoCircle.ANGULAR_TOLERANCE. |
Returns
boolean
Whether the query point lies between the start and end points of the specified arc.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:391
▸ isPointAlongArc(circle
, start
, angularWidth
, pos
, inclusive?
, tolerance?
): boolean
Checks if a point lies between the start and end points (inclusive) of an arc along a geo circle. The start and query points will be projected onto the arc's parent circle if they do not already lie on it.
Parameters
Name | Type | Description |
---|---|---|
circle | GeoCircle | The arc's parent circle. |
start | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The start point of the arc. |
angularWidth | number | The angular width of the arc, in radians. |
pos | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The query point. |
inclusive? | boolean | Whether the arc includes the start and end points. Defaults to true . |
tolerance? | number | The error tolerance, in great-arc radians. Defaults to GeoCircle.ANGULAR_TOLERANCE. |
Returns
boolean
Whether the query point lies between the start and end points (inclusive) of the specified arc.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:410
isVectorGreatCircle
▸ isVectorGreatCircle(vector
): boolean
Checks whether a circle vector describes a great-circle path.
Parameters
Name | Type | Description |
---|---|---|
vector | CircleVector | A flight path circle vector. |
Returns
boolean
Whether the vector describes a great-circle path.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:74
projectVelocityToCircle
▸ projectVelocityToCircle(speed
, position
, bearing
, projectTo
): number
Projects an instantaneous velocity at a point along a bearing onto a geo circle.
The projected velocity is defined as the limit as dt goes to 0 of:
distance( project(p(0)), project(p(dt)) ) / dt
p(0)
is the position at which the velocity to project is measured.p(x)
returnsp(0)
offset by the velocity to project afterx
time has elapsed.project(x)
projectsx
onto the geo circle onto which the velocity is to be projected.distance(x, y)
returns the distance fromx
toy
along the geo circle onto which the velocity is to be projected, in the range(-c / 2, c / 2]
, wherec
is the circumference of the geo circle.
Parameters
Name | Type | Description |
---|---|---|
speed | number | The magnitude of the velocity to project. |
position | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The position at which the velocity is measured. |
bearing | number | The true bearing, in degrees, defining the direction of the velocity to project. |
projectTo | GeoCircle | The geo circle to which to project the velocity. |
Returns
number
The signed magnitude of the velocity projected onto the specified geo circle. A positive sign indicates the projected velocity follows the same direction as the circle, while a negative sign indicates the projected velocity follows the opposite direction as the circle.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:467
▸ projectVelocityToCircle(speed
, position
, path
, projectTo
): number
Projects an instantaneous velocity at a point along a geo circle onto another geo circle.
The projected velocity is defined as the limit as dt goes to 0 of:
distance( project(p(0)), project(p(dt)) ) / dt
p(0)
is the position at which the velocity to project is measured.p(x)
returnsp(0)
offset by the velocity to project afterx
time has elapsed.project(x)
projectsx
onto the geo circle onto which the velocity is to be projected.distance(x, y)
returns the distance fromx
toy
along the geo circle onto which the velocity is to be projected, in the range(-c / 2, c / 2]
, wherec
is the circumference of the geo circle.
Parameters
Name | Type | Description |
---|---|---|
speed | number | The magnitude of the velocity to project. |
position | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The position at which the velocity is measured. |
path | GeoCircle | The geo circle defining the path parallel to the velocity to project. |
projectTo | GeoCircle | The geo circle to which to project the velocity. |
Returns
number
The signed magnitude of the velocity projected onto the specified geo circle. A positive sign indicates the projected velocity follows the same direction as the circle, while a negative sign indicates the projected velocity follows the opposite direction as the circle.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:493
resolveIngressToEgress
▸ resolveIngressToEgress<T
>(legCalc
): T
Resolves the ingress to egress vectors for a set of flight plan leg calculations. This operation will populate the
ingressToEgress
array with a sequence of vectors connecting the ingress transition to the egress transition
while following the flight path defined by the vectors in the flightPath
array.
Type parameters
Name | Type |
---|---|
T | extends LegCalculations |
Parameters
Name | Type | Description |
---|---|---|
legCalc | T | A set of flight plan leg calculations. |
Returns
T
The flight plan leg calculations, after the ingress to egress vectors have been resolved.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:545
reverseTurnCircle
▸ reverseTurnCircle(circle
, out
): GeoCircle
Reverses the direction of a turn circle while keeping the turn center and turn radius constant.
Parameters
Name | Type | Description |
---|---|---|
circle | GeoCircle | The turn circle to reverse. |
out | GeoCircle | A GeoCircle object to which to write the result. |
Returns
A turn circle which has the same turn center and turn radius, but the opposite direction as circle
.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:199
setCircleVector
▸ setCircleVector(vector
, circle
, start
, end
, flags
): CircleVector
Sets the parameters of a circle vector.
Parameters
Name | Type | Description |
---|---|---|
vector | CircleVector | The circle vector to set. |
circle | GeoCircle | The GeoCircle defining the vector's path. |
start | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The start of the vector. |
end | Readonly <Omit <Float64Array , "set" | "sort" | "copyWithin" >> | LatLonInterface | The end of the vector. |
flags | number | The flags to set on the vector. |
Returns
The circle vector, after its parameters have been set.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:43
setGeoCircleFromVector
▸ setGeoCircleFromVector(vector
, out
): GeoCircle
Sets the parameters of a GeoCircle from a flight path circle vector.
Parameters
Name | Type | Description |
---|---|---|
vector | CircleVector | A flight path circle vector. |
out | GeoCircle | The GeoCircle to set. |
Returns
The GeoCircle, after its parameters have been set.
Defined in
src/sdk/flightplan/FlightPathUtils.ts:84