Skip to content

Commit

Permalink
VHW SignalK#3
Browse files Browse the repository at this point in the history
  • Loading branch information
fsaux committed Jan 28, 2023
1 parent c0d74cf commit b376af9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sentences/VHW.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ module.exports = function (app) {
'navigation.speedThroughWater'
],
f: function vhw (headingTrue, magneticVariation, speedThroughWater) {
if (headingTrue !== null && magneticVariation !== null) {
var headingMagnetic = headingTrue + magneticVariation
var headingMagnetic
if (headingTrue && magneticVariation) {
headingMagnetic = headingTrue + magneticVariation
if (headingMagnetic > Math.PI * 2) {
headingMagnetic -= Math.PI * 2
}
Expand Down

0 comments on commit b376af9

Please sign in to comment.