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) ) {