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 _ )