Drawing3d documented Class Library

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

This method calculates the distance to a point only, if the distance is smaller then MaxDist, otherwise Utils.big will be returned. You can imagine a strip with width MaxDist along the line. If a point is placed on this strip, it is accepted and the distance will be calculated and returned. If CheckP is true, additional to the strip a half circle with center P and radius Maxdist is considered and analogusly for CheckQ.

[Visual Basic]
Public Overloads Sub Distance( _
   ByVal p As xy, _
   ByVal MaxDist As Double, _
   ByVal CheckP As Boolean, _
   ByVal CheckQ As Boolean, _
   ByRef Lam As Double _
)
[C#]
public double Distance(
   xy p,
   double MaxDist,
   bool CheckP,
   bool CheckQ,
   out double Lam
);

Parameters

p
The point to be tested
MaxDist
The maximal distance, for which a reasonable result can be provided.
CheckP
If CheckP is true: If the distance between p and this.P is less than MaxDist, it will be provided as a result. The value of Lam is zero.
CheckQ
If CheckQ is true: If the distance between p and this.Q is less than MaxDist, it will be provided as a result. The value of Lam is one.
Lam
The param Lam can be used 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 | Drawing3d.Math Namespace | LineType2d.Distance Overload List