Eliminate non-ascii comments in clipper (#5480)
parent
f95050e7aa
commit
bb9101ae9e
|
@ -4330,10 +4330,10 @@ double DistanceFromLineSqrd(
|
||||||
const IntPoint& pt, const IntPoint& ln1, const IntPoint& ln2)
|
const IntPoint& pt, const IntPoint& ln1, const IntPoint& ln2)
|
||||||
{
|
{
|
||||||
//The equation of a line in general form (Ax + By + C = 0)
|
//The equation of a line in general form (Ax + By + C = 0)
|
||||||
//given 2 points (x<EFBFBD>,y<>) & (x<>,y<>) is ...
|
//given 2 points (x_1, y_1) & (x_2, y_2) is ...
|
||||||
//(y<EFBFBD> - y<>)x + (x<> - x<>)y + (y<> - y<>)x<> - (x<> - x<>)y<> = 0
|
//(y_1 - y_2)x + (x_2 - x_1)y - (y_1 - y_2)x_1 - (x_2 - x_1)y_1 = 0
|
||||||
//A = (y<EFBFBD> - y<>); B = (x<> - x<>); C = (y<> - y<>)x<> - (x<> - x<>)y<>
|
//A = (y_1 - y_2); B = (x_2 - x_1); C = - (y_1 - y_2)x_1 - (x_2 - x_1)y_1
|
||||||
//perpendicular distance of point (x<EFBFBD>,y<>) = (Ax<41> + By<42> + C)/Sqrt(A<> + B<>)
|
//perpendicular distance of point (x_0, y_0) = |Ax_0 + By_0 + C| / Sqrt(A^2 + B^2)
|
||||||
//see http://en.wikipedia.org/wiki/Perpendicular_distance
|
//see http://en.wikipedia.org/wiki/Perpendicular_distance
|
||||||
double A = double(ln1.Y - ln2.Y);
|
double A = double(ln1.Y - ln2.Y);
|
||||||
double B = double(ln2.X - ln1.X);
|
double B = double(ln2.X - ln1.X);
|
||||||
|
|
Loading…
Reference in New Issue