Sign in to follow this  
fguihen

checking if a number is within a range.

Recommended Posts

i have a point eg(20,20). i need to check if this is on two line segments. so i have to compare it against 4 other points, each end point of the two lines. this makes a rather large and cumbersome nested if statement, and im wondering if theres any other way that this can be done, or if theres any algorithm that will do it for me. at present my if statment method has a few bugs that arnt easily solved, eg, if the line is sloping away from the origin, it fails. thanks all

Share this post


Link to post
Share on other sites
no, i can find this, but to make sure its on the line segments, not on the lines which go on infinately, an something is needed to check the point is within the bounds of the lines

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this