Permalink
Browse files

Fixed bug in collection->length()

Was using ^2 instead of pow(N,2)
  • Loading branch information...
1 parent 2e0b66b commit 6d8bde11316b42403161febad17bff7fa9e643a6 George Zankevich committed Jun 12, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/geometry/Collection.class.php
View
2 lib/geometry/Collection.class.php
@@ -165,7 +165,7 @@ public function length() {
$next_point = $this->geometryN($delta);
if ($next_point) {
// Pythagorean Theorem
- $distance = sqrt(($next_point->getX() - $point->getX())^2+($next_point->getY()- $point->getY())^2);
+ $distance = sqrt(pow(($next_point->getX() - $point->getX()), 2) + pow(($next_point->getY()- $point->getY()), 2));
$length += $distance;
}
}

0 comments on commit 6d8bde1

Please sign in to comment.