Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Oct 4, 2017
1 parent e08077e commit 84bc514
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/Util.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,15 @@ define( function( require ) {
return a.x * (b.y - c.y) + b.x * (c.y - a.y) + c.x * (a.y - b.y);
},

/**
* Polyfill for Math.sign from MDN, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign
* We cannot use Math.sign because it is not supported on IE
* @param {number} x
* @returns {number}
*/
sign: function( x ) {
return ((x > 0) - (x < 0)) || +x;
},

/**
* Function that returns the hyperbolic cosine of a number
Expand Down

0 comments on commit 84bc514

Please sign in to comment.