Skip to content

Commit

Permalink
fix: subtract magneticVariation to from directionTrue to get directio…
Browse files Browse the repository at this point in the history
…nMagnetic
  • Loading branch information
sbender9 committed Mar 28, 2018
1 parent 58e9c1b commit 8b0db6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions calcs/windDirectionMagnetic.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) ) {
Expand Down

0 comments on commit 8b0db6a

Please sign in to comment.