diff --git a/src/Magnum/Math/Geometry/Distance.h b/src/Magnum/Math/Geometry/Distance.h index 634a0c69a..cacf5f836 100644 --- a/src/Magnum/Math/Geometry/Distance.h +++ b/src/Magnum/Math/Geometry/Distance.h @@ -170,7 +170,7 @@ class Distance { * * The distance **d** is computed from point **p** and plane with * normal **n** and **w** using: @f[ - * d = \frac{\sum_i^3 (p \cdot n) + w}{\left| n \right|} + * d = \frac{p \cdot n + w}{\left| n \right|} * @f] * The distance is negative if the point lies behind the plane. * @@ -188,7 +188,7 @@ class Distance { * * The distance **d** is computed from point **p** and plane with * normal **n** and **w** using: @f[ - * d = \sum_i^3 (p \cdot n) + w + * d = p \cdot n + w * @f] * The distance is negative if the point lies behind the plane. * @@ -198,7 +198,7 @@ class Distance { * @see @ref pointPlaneNormalized() */ template static T pointPlaneScaled(const Vector3& point, const Vector4& plane) { - return (plane.xyz()*point).sum() + plane.w(); + return Math::dot(plane.xyz(), point) + plane.w(); } /** @@ -206,7 +206,7 @@ class Distance { * * The distance **d** is computed from point **p** and plane with * normal **n** and **w** using: @f[ - * d = \sum_i^3 (p \cdot n) + w + * d = p \cdot n + w * @f] * The distance is negative if the point lies behind the plane. Expects * that @p plane normal is normalized.