|
|
| Vector 2 Vector intersection |
|
sicgamemaker
Member #1,365
June 2001
|
i know htere is a formula for calculating if 2 vectors are going to intersect...what is this formula? i cant seem to find it, and i could use it _______________________ |
|
Peter Hull
Member #1,136
March 2001
|
2d or 3d? |
|
sicgamemaker
Member #1,365
June 2001
|
haha, yeah, i shoulda said that before...in 2D _______________________ |
|
Bob
Free Market Evangelist
September 2000
|
Vectors can't "intersect". Or do you mean line-line intersection? Or do you mean non-parallel vectors? -- |
|
sicgamemaker
Member #1,365
June 2001
|
ahh what i mean is line to line intersection.. 2 dimensions... _______________________ |
|
Korval
Member #1,538
September 2001
|
Express the vectors as linear equations: a1*x + b1*y + c1 = 0; You have two equations and two unknowns (x and y). Solve this system of equations. If a1 == a2 and b1 == b2, then the lines are parallel, and there is no solution, since they don't intersect. You probably have them in vector form (a direction [xDir, yDir] and a point on the line [xPos, yPos]). It's a simple matter to get them into this form. a1 = xDir, b1 = yDir, and you will have to use the point-slope form of the linear equations (which I have forgotten) to get c1. |
|
Thomas Harte
Member #33
April 2000
|
You also want to worry about the case where vectors are parallel and on top of each other - then they can intersect but obviously have no unique point of intersection. In my opinion, the most simple idea is this :
Obviously if you want to know the exact point of intersection, don't just throw away (ix,iy). [My site] [Tetrominoes] |
|
|