summaryrefslogtreecommitdiffstats
path: root/Algorithms/Part-I/5-KdTrees/PointSET.java
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-03-27 12:44:06 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-15 17:38:45 +0100
commit883262806aaa1deacd1e1482e2136f8857e515ed (patch)
tree72b87f3f9c5b5073264894310b1a54c3bfbc722c /Algorithms/Part-I/5-KdTrees/PointSET.java
parent6e5558c4c38957622216de24f2d115a0da90cce6 (diff)
downloadcoursera-883262806aaa1deacd1e1482e2136f8857e515ed.zip
coursera-883262806aaa1deacd1e1482e2136f8857e515ed.tar.gz
Algorithms-I : 5-KdTrees: speed up maths
Diffstat (limited to 'Algorithms/Part-I/5-KdTrees/PointSET.java')
-rw-r--r--Algorithms/Part-I/5-KdTrees/PointSET.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/Algorithms/Part-I/5-KdTrees/PointSET.java b/Algorithms/Part-I/5-KdTrees/PointSET.java
index f5594de..5500512 100644
--- a/Algorithms/Part-I/5-KdTrees/PointSET.java
+++ b/Algorithms/Part-I/5-KdTrees/PointSET.java
@@ -61,7 +61,7 @@ public class PointSET
double d = Double.MAX_VALUE;
for (Point2D o : set)
{
- double d2 = p.distanceTo(o);
+ double d2 = p.distanceSquaredTo(o);
if (d2 < d) {
d = d2;
p0 = o;