Remove use of toDegrees/toRadians util functions

Instead of goog.math.toRadians and goog.math.toDegrees, we now use
our own implementations of these basic conversion functions.
This commit is contained in:
Marc Jansen
2015-10-12 21:10:37 +02:00
parent 758bab8e30
commit 47a7b03e0e
9 changed files with 81 additions and 33 deletions

View File

@@ -123,3 +123,25 @@ ol.math.tanh = function(x) {
var expMinusTwoX = Math.exp(-2 * x);
return (1 - expMinusTwoX) / (1 + expMinusTwoX);
};
/**
* Converts radians to to degrees.
*
* @param {number} angleInRadians Angle in radians.
* @return {number} Angle in degrees.
*/
ol.math.toDegrees = function(angleInRadians) {
return angleInRadians * 180 / Math.PI;
};
/**
* Converts degrees to radians.
*
* @param {number} angleInDegrees Angle in degrees.
* @return {number} Angle in radians.
*/
ol.math.toRadians = function(angleInDegrees) {
return angleInDegrees * Math.PI / 180;
};