UNPKG

aviation-math

Version:

Different methods to calculate distances, bearing and projections for aviation related software

25 lines (24 loc) 927 B
import { DegreesTrue } from "./common"; import { Position } from "./position"; /** * Calculates the intercept points of two Coordinates and two bearings. The function * returns an array of two points since its projection on a sphere. The closer intersection * will be on the first item of the array. * * @example * const intersectionList = projectBearingIntersection( * new Position(39.778889, -104.9825), * 0, * new Position(43.778889, -102.9825), * 0, * ); * // intersectionList[0].lat = 90 * // intersectionList[1].lat = -90 * * @param point1 The first position * @param bearing1 The first bearing * @param point2 The second position * @param bearing2 The second bearing * @returns An array with two intersection positions */ export declare function projectBearingIntersection(position1: Position, bearing1: DegreesTrue, position2: Position, bearing2: DegreesTrue): [Position, Position];