Hi,
thanks for publishing the codebase for your nice NMEA generator. I noticed that the bearing calculated and written into the nmea-messages differs from the bearing (or azimuth) i get when calculating it myself or using an online calculator. The calculation itself seems to be correct, but i possibly found an error in the angle conversion from degrees to radians. The function degreesToRadians at line 627 in main.js seems to be wrong. After changing this, the bearing is identical to the azimuth i got from an online calculator.
current implementation:
function degreesToRadians(degrees) { return degrees / 180.0 / Math.PI; }
proposed implementation: function degreesToRadians(degrees) { return degrees / 180.0 * Math.PI; }
Hi, thanks for publishing the codebase for your nice NMEA generator. I noticed that the bearing calculated and written into the nmea-messages differs from the bearing (or azimuth) i get when calculating it myself or using an online calculator. The calculation itself seems to be correct, but i possibly found an error in the angle conversion from degrees to radians. The function
degreesToRadians
at line 627 inmain.js
seems to be wrong. After changing this, the bearing is identical to the azimuth i got from an online calculator.current implementation:
function degreesToRadians(degrees) { return degrees / 180.0 / Math.PI; }
proposed implementation:function degreesToRadians(degrees) { return degrees / 180.0 * Math.PI; }