diff --git a/README.md b/README.md index c495220..9060c27 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ LGAV 03L BIBE1K SID (Cycle 2507, ID 10653) While similar to an RF, the center point is coded differently. -Calculate distance for FMS based on ` 2 * π NavDist * abs(NavBear - Course) 360`. +Calculate distance for FMS based on `2 * π * NavDist * abs(NavBear - Course) 360`. ## Course to Altitude (CA) diff --git a/md11-nav-data/src/parser/utils/getCourseAndFixForIntercepts.ts b/md11-nav-data/src/parser/utils/getCourseAndFixForIntercepts.ts index 50b66f8..c10379c 100644 --- a/md11-nav-data/src/parser/utils/getCourseAndFixForIntercepts.ts +++ b/md11-nav-data/src/parser/utils/getCourseAndFixForIntercepts.ts @@ -1,3 +1,4 @@ +import computeDestinationPoint from 'geolib/es/computeDestinationPoint'; import getGreatCircleBearing from 'geolib/es/getGreatCircleBearing'; /** @@ -29,8 +30,12 @@ export const getCourseAndFixForIntercepts = (leg: TerminalEntry, origin: NavFix) } case 'AF': { const _leg = leg as AFTerminalEntry; - const fix = { latitude: _leg.WptLat, longitude: _leg.WptLon }; - return [_leg.Course.reciprocalCourse().toTrue(fix), fix]; + const navAid = { latitude: _leg.NavLat, longitude: _leg.NavLon }; + const fix = { + ...computeDestinationPoint(navAid, _leg.NavDist.toMetre(), _leg.Course.toTrue(navAid)), + isIntersection: true, + }; + return [_leg.Course.toTrue(fix), fix]; } case 'DF': { const _leg = leg as DFTerminalEntry;