Sign in to follow this  
fguihen

checking all points on a line rather than just one against another line

Recommended Posts

if i have two lines, and both of their end points and equations, is there a way i can do a check of one line against the other, rather than testing every point of one line against the other?

Share this post


Link to post
Share on other sites
yes.

would you like to know it?

google is your friend.

seriously, half the topics on this board are by you, and this wouldnt be the first one that could be answered by a ten second google search.

Share this post


Link to post
Share on other sites
i have done a google search on this and can only find the intersection of a point on a line, but no formula to check all points of one line against another. anyway, are forums not where people come to ask questions? my questions might seem basic to you, but they are quite difficult to me, so just because you understand, dont think anyone else does. if the admin has a prob with all my posts he'l deal with it. you are not the forum admin

Share this post


Link to post
Share on other sites
Quote:
Original post by fguihen
i have done a google search on this and can only find the intersection of a point on a line, but no formula to check all points of one line against another.

no surprise, since that doesnt even make the slightest bit of sense. there are infinitly many points on a line, so checking them all doesnt seem like a good idea to me.

google for 'line intersection' (not that hard to come up with, is it?)

first and third links give equal but respectively precise and short answers to your question.

Quote:

anyway, are forums not where people come to ask questions? my questions might seem basic to you, but they are quite difficult to me, so just because you understand, dont think anyone else does. if the admin has a prob with all my posts he'l deal with it. you are not the forum admin

im not. nonetheless i feel its my right aswell as my duty to try and make you a little less dependant.

Share this post


Link to post
Share on other sites
I agree with eelco

I typed this in google:

"line intersection 2d"

Wasn't very hard to find the info! As usual google came up with the goods. By the way this guy's website has loads of geometrical goodies!

Share this post


Link to post
Share on other sites
Folks,

I don't find anything wrong with fguihen's question. Yes, it is a bit naive, but that's okay. As long as posts remain approximately on topic (game development and specifically not requests for solutions to school problems + the usual general forum rules), then they can remain open. The wording on this one sounds on-topic-ish, so I have no problem with the post. Please do not be so quick to attack!

That said, I agree with Eelco and TheFatGecko. The answer isn't checking all the points on the line individually (impossible to do), but to solve the line/line intersection problem.

TheFatGecko's link does contain the answer, in 2D and 3D, but I don't like the organization of the site. So, here are some directly links:

Intersection Point of Two Lines (2 dimensions)

Shortest line between two lines in 3D

Those two pages compute the intersection or nearest point of two lines quite smartly.

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