|
|
|
@@ -251,7 +251,7 @@ public: |
|
|
|
*/
|
|
|
|
Point<ValueType> getPointAlongLineProportionally (typename Point<ValueType>::FloatType proportionOfLength) const noexcept
|
|
|
|
{
|
|
|
|
return start + Point<ValueType> ((end - start) * proportionOfLength);
|
|
|
|
return start + (end - start) * proportionOfLength;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Returns the smallest distance between this line segment and a given point.
|
|
|
|
@@ -274,11 +274,11 @@ public: |
|
|
|
if (length > 0)
|
|
|
|
{
|
|
|
|
auto prop = ((targetPoint.x - start.x) * delta.x
|
|
|
|
+ (targetPoint.y - start.y) * delta.y) / length;
|
|
|
|
+ (targetPoint.y - start.y) * delta.y) / (double) length;
|
|
|
|
|
|
|
|
if (prop >= 0 && prop <= 1.0)
|
|
|
|
{
|
|
|
|
pointOnLine = start + delta * static_cast<ValueType> (prop);
|
|
|
|
pointOnLine = start + delta * prop;
|
|
|
|
return targetPoint.getDistanceFrom (pointOnLine);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|