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

@@ -196,4 +196,31 @@ describe('ol.math.tanh', function() {
});
describe('ol.math.toDegrees', function() {
it('returns the correct value at -π', function() {
expect(ol.math.toDegrees(-Math.PI)).to.be(-180);
});
it('returns the correct value at 0', function() {
expect(ol.math.toDegrees(0)).to.be(0);
});
it('returns the correct value at π', function() {
expect(ol.math.toDegrees(Math.PI)).to.be(180);
});
});
describe('ol.math.toRadians', function() {
it('returns the correct value at -180', function() {
expect(ol.math.toRadians(-180)).to.be(-Math.PI);
});
it('returns the correct value at 0', function() {
expect(ol.math.toRadians(0)).to.be(0);
});
it('returns the correct value at 180', function() {
expect(ol.math.toRadians(180)).to.be(Math.PI);
});
});
goog.require('ol.math');