An NDoc Documented Class Library

LineType2d.Distance Method (xy, Double, Boolean, Boolean, Double)

This method calculates the distance to a point only in case, when the distance is smaller then MaxDist else Utils.big will be returned. You can imagine a strip with width MaxDist along the line. If now a point lays into the strip, then this is a good one and the distance will be calculated and returned. If CheckP is true then additional to the strip a halfcircle with center P and radius Maxdist is considered and analogusly for CheckQ.

public double Distance(
   xy p,
   double MaxDist,
   bool CheckP,
   bool CheckQ,
   out double Lam
);

Parameters

p
The point, which will be tested
MaxDist
The maximal distance, for what a line a good result returns
CheckP
If CheckP is true a line, which has to point P a distance smaller then Maxdist returns good results
CheckQ
If CheckQ is true a line, which has to point Q a distance smaller then Maxdist returns good results
Lam
The param Lam can be taken to calculate the nearest point on the line by Value(Lam)

Return Value

In case the distance of the line is smaller then Maxdist, the distance is returned else big

See Also

LineType2d Class | Minais.Drawing3d.Math Namespace | LineType2d.Distance Overload List