Remove goog.math.modulo and goog.math.lerp
This commit is contained in:
committed by
Frédéric Junod
parent
19fd3d6987
commit
2ee1969de7
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.geom.flat.closest');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
@@ -31,7 +30,7 @@ ol.geom.flat.closest.point = function(flatCoordinates, offset1, offset2, stride,
|
||||
offset = offset2;
|
||||
} else if (t > 0) {
|
||||
for (i = 0; i < stride; ++i) {
|
||||
closestPoint[i] = goog.math.lerp(flatCoordinates[offset1 + i],
|
||||
closestPoint[i] = ol.math.lerp(flatCoordinates[offset1 + i],
|
||||
flatCoordinates[offset2 + i], t);
|
||||
}
|
||||
closestPoint.length = stride;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
goog.provide('ol.geom.flat.interpolate');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.math');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
@@ -52,9 +52,9 @@ ol.geom.flat.interpolate.lineString = function(flatCoordinates, offset, end, str
|
||||
var t = (target - cumulativeLengths[-index - 2]) /
|
||||
(cumulativeLengths[-index - 1] - cumulativeLengths[-index - 2]);
|
||||
var o = offset + (-index - 2) * stride;
|
||||
pointX = goog.math.lerp(
|
||||
pointX = ol.math.lerp(
|
||||
flatCoordinates[o], flatCoordinates[o + stride], t);
|
||||
pointY = goog.math.lerp(
|
||||
pointY = ol.math.lerp(
|
||||
flatCoordinates[o + 1], flatCoordinates[o + stride + 1], t);
|
||||
} else {
|
||||
pointX = flatCoordinates[offset + index * stride];
|
||||
@@ -127,7 +127,7 @@ ol.geom.flat.lineStringCoordinateAtM = function(flatCoordinates, offset, end, st
|
||||
coordinate = [];
|
||||
var i;
|
||||
for (i = 0; i < stride - 1; ++i) {
|
||||
coordinate.push(goog.math.lerp(flatCoordinates[(lo - 1) * stride + i],
|
||||
coordinate.push(ol.math.lerp(flatCoordinates[(lo - 1) * stride + i],
|
||||
flatCoordinates[lo * stride + i], t));
|
||||
}
|
||||
coordinate.push(m);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
goog.provide('ol.geom.Polygon');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.math');
|
||||
goog.require('ol');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.extent');
|
||||
@@ -19,6 +18,7 @@ goog.require('ol.geom.flat.interiorpoint');
|
||||
goog.require('ol.geom.flat.intersectsextent');
|
||||
goog.require('ol.geom.flat.orient');
|
||||
goog.require('ol.geom.flat.simplify');
|
||||
goog.require('ol.math');
|
||||
|
||||
|
||||
/**
|
||||
@@ -467,7 +467,7 @@ ol.geom.Polygon.makeRegular = function(polygon, center, radius, opt_angle) {
|
||||
var angle, offset;
|
||||
for (var i = 0; i <= sides; ++i) {
|
||||
offset = i * stride;
|
||||
angle = startAngle + (goog.math.modulo(i, sides) * 2 * Math.PI / sides);
|
||||
angle = startAngle + (ol.math.modulo(i, sides) * 2 * Math.PI / sides);
|
||||
flatCoordinates[offset] = center[0] + (radius * Math.cos(angle));
|
||||
flatCoordinates[offset + 1] = center[1] + (radius * Math.sin(angle));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user