Beispiel #1
0
RNLength R2Distance(const R2Point& point, const R2Line& line)
{
    // Return distance from point to line 
    RNLength d = point.X() * line.A() + point.Y() * line.B() + line.C();
    return (d < 0.0) ? -d : d;
}
Beispiel #2
0
RNLength R2SignedDistance(const R2Line& line, const R2Point& point)
{
    // Return signed distance from point to line 
    return (point.X()*line.A() + point.Y()*line.B() + line.C());
}