signalk-polar-performance-plugin 0.0.31 → 0.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/plugin/index.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signalk-polar-performance-plugin",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "A plugin that calculates performance information based on a (CSV) polar diagram.",
5
5
  "main": "plugin/index.js",
6
6
  "scripts": {
package/plugin/index.js CHANGED
@@ -674,7 +674,7 @@ module.exports = function (app) {
674
674
  damping[unit] = {Yn: Xn, dt: Date.now()}
675
675
  }
676
676
  // Edge case when hovering around -pi and +pi
677
- if (Xn > Math.PI && damping[unit].Yn < (0-Math.PI)) {
677
+ if (Xn > halfPi && damping[unit].Yn < (0-halfPi)) {
678
678
  Xn = Xn - (2*Math.PI)
679
679
  } else if (Xn < (0-Math.PI) && damping[unit].Yn > Math.PI) {
680
680
  Xn = Xn + (2*Math.PI)