Created
February 28, 2012 21:56
-
-
Save anonymous/1935517 to your computer and use it in GitHub Desktop.
a guest on Feb 28th, 2012 - pastebin.com/1YXe6Nvd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0; i < mapPoints.length; i++){ | |
for (var j = i + 1; j < mapPoints.length; j++){ | |
var p1 = mapPoints[i]; | |
var p2 = mapPoints[j]; | |
if (getDistance(p1, p2) < 0.1){ // If distance between points is greater than .1 km | |
var midpoint = getMidpoint(p1, p2); | |
mapPoints.push(midpoint); | |
mapPoints.splice(i, 1); | |
mapPoints.splice(j, 1); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment