From 8ec2bcef17cb9826ae6c396579549928f6336f8f Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sun, 23 Aug 2015 11:46:20 -0600 Subject: [PATCH] Remove unused sphere.finalBearing() method --- src/ol/sphere/sphere.js | 12 ------------ test/spec/ol/sphere/sphere.test.js | 28 ---------------------------- 2 files changed, 40 deletions(-) diff --git a/src/ol/sphere/sphere.js b/src/ol/sphere/sphere.js index 580bd033d8..86a3d9a7f9 100644 --- a/src/ol/sphere/sphere.js +++ b/src/ol/sphere/sphere.js @@ -88,18 +88,6 @@ ol.Sphere.prototype.equirectangularDistance = function(c1, c2) { }; -/** - * Returns the final bearing from c1 to c2. - * - * @param {ol.Coordinate} c1 Coordinate 1. - * @param {ol.Coordinate} c2 Coordinate 2. - * @return {number} Initial bearing. - */ -ol.Sphere.prototype.finalBearing = function(c1, c2) { - return (this.initialBearing(c2, c1) + 180) % 360; -}; - - /** * Returns the distance from c1 to c2 using the haversine formula. * diff --git a/test/spec/ol/sphere/sphere.test.js b/test/spec/ol/sphere/sphere.test.js index a3c59ee7b4..d127266db7 100644 --- a/test/spec/ol/sphere/sphere.test.js +++ b/test/spec/ol/sphere/sphere.test.js @@ -13,7 +13,6 @@ describe('ol.Sphere', function() { c1: [0, 0], c2: [0, 0], equirectangularDistance: 0, - finalBearing: 180, haversineDistance: 0, initialBearing: 0, midpoint: [0, 0] @@ -22,7 +21,6 @@ describe('ol.Sphere', function() { c1: [0, 0], c2: [45, 45], equirectangularDistance: 6812.398372654371, - finalBearing: 54.735610317245346, haversineDistance: 6671.695598673525, initialBearing: 35.264389682754654, midpoint: [18.434948822922006, 24.0948425521107] @@ -31,7 +29,6 @@ describe('ol.Sphere', function() { c1: [0, 0], c2: [-45, 45], equirectangularDistance: 6812.398372654371, - finalBearing: 305.26438968275465, haversineDistance: 6671.695598673525, initialBearing: -35.264389682754654, midpoint: [-18.434948822922006, 24.0948425521107] @@ -40,7 +37,6 @@ describe('ol.Sphere', function() { c1: [0, 0], c2: [-45, -45], equirectangularDistance: 6812.398372654371, - finalBearing: 234.73561031724535, haversineDistance: 6671.695598673525, initialBearing: -144.73561031724535, midpoint: [-18.434948822922006, -24.0948425521107] @@ -49,7 +45,6 @@ describe('ol.Sphere', function() { c1: [0, 0], c2: [45, -45], equirectangularDistance: 6812.398372654371, - finalBearing: 125.26438968275465, haversineDistance: 6671.695598673525, initialBearing: 144.73561031724535, midpoint: [18.434948822922006, -24.0948425521107] @@ -58,7 +53,6 @@ describe('ol.Sphere', function() { c1: [45, 45], c2: [45, 45], equirectangularDistance: 0, - finalBearing: 180, haversineDistance: 0, initialBearing: 0, midpoint: [45.00000000000005, 45] @@ -67,7 +61,6 @@ describe('ol.Sphere', function() { c1: [45, 45], c2: [-45, 45], equirectangularDistance: 7076.401799751738, - finalBearing: 234.73561031724535, haversineDistance: 6671.695598673525, initialBearing: -54.73561031724535, midpoint: [0, 54.735610317245346] @@ -76,7 +69,6 @@ describe('ol.Sphere', function() { c1: [45, 45], c2: [-45, -45], equirectangularDistance: 14152.803599503475, - finalBearing: 234.73561031724535, haversineDistance: 13343.391197347048, initialBearing: -125.26438968275465, midpoint: [0, 0] @@ -85,7 +77,6 @@ describe('ol.Sphere', function() { c1: [45, 45], c2: [45, -45], equirectangularDistance: 10007.543398010286, - finalBearing: 180, haversineDistance: 10007.543398010286, initialBearing: 180, midpoint: [45.00000000000005, 0] @@ -94,7 +85,6 @@ describe('ol.Sphere', function() { c1: [-45, 45], c2: [-45, 45], equirectangularDistance: 0, - finalBearing: 180, haversineDistance: 0, initialBearing: 0, midpoint: [-45.00000000000005, 45] @@ -103,7 +93,6 @@ describe('ol.Sphere', function() { c1: [-45, 45], c2: [-45, -45], equirectangularDistance: 10007.543398010286, - finalBearing: 180, haversineDistance: 10007.543398010286, initialBearing: 180, midpoint: [-45.00000000000005, 0] @@ -112,7 +101,6 @@ describe('ol.Sphere', function() { c1: [-45, 45], c2: [45, -45], equirectangularDistance: 14152.803599503475, - finalBearing: 125.26438968275465, haversineDistance: 13343.391197347048, initialBearing: 125.26438968275465, midpoint: [0, 0] @@ -121,7 +109,6 @@ describe('ol.Sphere', function() { c1: [-45, -45], c2: [-45, -45], equirectangularDistance: 0, - finalBearing: 180, haversineDistance: 0, initialBearing: 0, midpoint: [-45.00000000000005, -45] @@ -130,7 +117,6 @@ describe('ol.Sphere', function() { c1: [-45, -45], c2: [45, -45], equirectangularDistance: 7076.401799751738, - finalBearing: 54.735610317245346, haversineDistance: 6671.695598673525, initialBearing: 125.26438968275465, midpoint: [0, -54.735610317245346] @@ -139,7 +125,6 @@ describe('ol.Sphere', function() { c1: [45, -45], c2: [45, -45], equirectangularDistance: 0, - finalBearing: 180, haversineDistance: 0, initialBearing: 0, midpoint: [45.00000000000005, -45] @@ -159,19 +144,6 @@ describe('ol.Sphere', function() { }); - describe('finalBearing', function() { - - it('results match Chris Veness\'s reference implementation', function() { - var e, i; - for (i = 0; i < expected.length; ++i) { - e = expected[i]; - expect(sphere.finalBearing(e.c1, e.c2)).to.roughlyEqual( - e.finalBearing, 1e-9); - } - }); - - }); - describe('haversineDistance', function() { it('results match Chris Veness\'s reference implementation', function() {