Skip to content

Commit

Permalink
Add XTE-GC to produce XTE w.r.t great circle
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei authored and tkurki committed May 8, 2022
1 parent d6fbc22 commit 0c9b3e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions sentences/XTE-GC.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Cross-track error:
$IIXTE,A,A,x.x,a,N,A*hh
I_Cross-track error in miles, L= left, R= right
*/
// to verify
const nmea = require('../nmea.js')
module.exports = function (app) {
return {
title: 'XTE - Cross-track error (w.r.t. Great Circle)',
keys: ['navigation.courseGreatCircle.crossTrackError'],
f: function (crossTrackError) {
return nmea.toSentence([
'$IIXTE',
'A',
'A',
nmea.mToNm(crossTrackError).toFixed(3),
crossTrackError < 0 ? 'R' : 'L',
'N'
])
}
}
}
2 changes: 1 addition & 1 deletion sentences/XTE.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $IIXTE,A,A,x.x,a,N,A*hh
const nmea = require('../nmea.js')
module.exports = function (app) {
return {
title: 'XTE - Cross-track error',
title: 'XTE - Cross-track error (w.r.t. Rhumb line)',
keys: ['navigation.courseRhumbline.crossTrackError'],
f: function (crossTrackError) {
return nmea.toSentence([
Expand Down

0 comments on commit 0c9b3e8

Please sign in to comment.