Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed bug in collection->length()

Was using ^2 instead of pow(N,2)
  • Loading branch information...
commit 6d8bde11316b42403161febad17bff7fa9e643a6 1 parent 2e0b66b
George Zankevich authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/geometry/Collection.class.php
2  lib/geometry/Collection.class.php
View
@@ -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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.