|
-
August 3rd, 2010, 08:45 AM
#9
Re: Check a Point lies in a Line segment
 Originally Posted by Zachm
I assumed (and later was proved correct) that the is_between function checks that x >= x1 (-tolerance) and that x <= x2 (+tolerance). This implies that x2 must be greater than x1, so x2-x1 is a positive number.
Regards,
Zachm
Ok, so maybe I wasn't proved to be correct in the end 
You are correct again. The above code may return unwanted results due to the specific implementation of the is_between function and it is solved by using fabs as you suggested.
It seems you have 100% understanding of the code above and a keen eye to see that bug in the code, so you don't have to feel confused so much 
Regards,
Zachm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|