From 8b0db6a0f33927adc3a5903c63eeb89b4fda69ee Mon Sep 17 00:00:00 2001 From: Scott Bender Date: Wed, 28 Mar 2018 17:05:10 -0400 Subject: [PATCH] fix: subtract magneticVariation to from directionTrue to get directionMagnetic --- calcs/windDirectionMagnetic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/calcs/windDirectionMagnetic.js b/calcs/windDirectionMagnetic.js index deb3b0d..aadb52e 100644 --- a/calcs/windDirectionMagnetic.js +++ b/calcs/windDirectionMagnetic.js @@ -4,10 +4,10 @@ module.exports = function(app, plugin) { return { group: 'wind', optionKey: 'directionMagnetic', - title: "Magnetic Wind Direction (based on wind.directionTrue and magenticVarition)", + title: "Magnetic Wind Direction (based on wind.directionTrue and magneticVarition)", derivedFrom: [ "environment.wind.directionTrue", "navigation.magneticVariation" ], calculator: function(directionTrue, magneticVariation) { - var directionMagnetic = directionTrue + magneticVariation + var directionMagnetic = directionTrue - magneticVariation if ( directionMagnetic < 0 ) { directionMagnetic = (Math.PI*2) + directionMagnetic } else if ( directionMagnetic > (Math.PI*2) ) {