Closed dzfranklin closed 3 years ago
I've been meaning to fix this for a long time!
I struggled originally to get the wrap90()
and wrap180()
functions to work correctly for all inputs of negative degrees (< -270°); spending a bit more time on it, I've worked out that this was because the JavaScript '%' operator is a 'rem' operator rather than a 'mod' operator, which handles negative dividends differently; I've also worked out the full forms of the triangle/sawtooth wave functions and based the code more closely on those so that the operation is clearer.
wrap90()
and wrap180()
now work correctly for all inputs.
In dms.js:320 there is the line
I don't understand what the comment means, or what implications this has.