Remove goog.math.modulo and goog.math.lerp
This commit is contained in:
committed by
Frédéric Junod
parent
19fd3d6987
commit
2ee1969de7
@@ -179,3 +179,27 @@ ol.math.toDegrees = function(angleInRadians) {
|
||||
ol.math.toRadians = function(angleInDegrees) {
|
||||
return angleInDegrees * Math.PI / 180;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the modulo of a / b, depending on the sign of b.
|
||||
*
|
||||
* @param {number} a Dividend.
|
||||
* @param {number} b Divisor.
|
||||
* @return {number} Modulo.
|
||||
*/
|
||||
ol.math.modulo = function(a, b) {
|
||||
var r = a % b;
|
||||
return r * b < 0 ? r + b : r;
|
||||
};
|
||||
|
||||
/**
|
||||
* Calculates the linearly interpolated value of x between a and b.
|
||||
*
|
||||
* @param {number} a Number
|
||||
* @param {number} b Number
|
||||
* @param {number} x Value to be interpolated.
|
||||
* @return {number} Interpolated value.
|
||||
*/
|
||||
ol.math.lerp = function(a, b, x) {
|
||||
return a + x * (b - a);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user