image
Physics Forums Logo
image
image
* Register * Upgrade Blogs Library Staff Rules Mark Forums Read
image
image   image
image

Go Back   Physics Forums > Mathematics > General Math


Reply

image Lines intersect and reflect Share It Thread Tools Search this Thread image
Old Jun27-09, 04:28 PM                  #1
sundar0206

sundar0206 is Offline:
Posts: 9
Lines intersect and reflect

I have been coming across a very very basic mathematics problem and still cant get my head around it. Should admit not the best to really talk maths to but I need the following

I am doin a collision detection algorithm..

For this I have a point that moves .I got the position of the point. But then here is the problem.

How do i really find where the vector in which the point moves intersect with a line....

If It intersects I need to reflect the vector..

Would be really nice to help me out in this issue..

Also can someone explain to me how the equation of the line AX+BY+C = 0 y=mx+c and the normals related ....

Also how does one fine a line perpendicular to another..

Well too many question and very unordered. Sorry about that . Jus typed all the questions on my mind

Regards
  Reply With Quote
Old Jun27-09, 10:38 PM                  #2
Mentallic

Mentallic is Offline:
Posts: 787
Re: Lines intersect and reflect

Originally Posted by sundar0206 View Post
For this I have a point that moves .I got the position of the point. But then here is the problem.

How do i really find where the vector in which the point moves intersect with a line....

If It intersects I need to reflect the vector..
I haven't studied vectors in great detail, so I'm finding it hard to understand exactly what you're saying here, however, I will give it a shot and hopefully it'll be along the lines (no pun intended) of what you're looking for.

If a point is moving along a plane, defined by some function y=f(x), it will intersect the line ax+by+c=0 if and only if there are real solutions for x (and thus y also) that satisfies both functions.

e.g. particle moves along LaTeX Code: y=x^2 , to find if it intersects LaTeX Code: 3x-y-2=0 simply solve these simultaneously. i.e. substitute LaTeX Code: y=x^2 into the line equation.

Hence,
LaTeX Code: 3x-(x^2)-2=0
LaTeX Code: x^2-3x+2=0
LaTeX Code: (x-2)(x-1)=0
LaTeX Code: x=1,2

So the intersections are at x=1 and x=2. Finding the y-value, sub these x-values back into one of the functions. So, LaTeX Code: y=1^2,2^2 Therefore the points of intersection are (1,1) and (2,4).

To find the angle at which the particle travelling along LaTeX Code: y=x^2 'collided' with the line, find the gradient of the tangent at the point of collision and the gradient of the line by the use of calculus.

Lets just take the point (1,1).
LaTeX Code: y=x^2
LaTeX Code: dy/dx=2x
At x=1, LaTeX Code: dy/dx=2

So the gradient is 2 while the gradient of the line is... LaTeX Code: y=3x-2 comparing to y=mx+b where m is the gradient, hence, 3.

Now use the formula LaTeX Code: tan(\\theta) =\\frac{tan(m_1)-tan(m_2)}{1-tan(m_1)tan(m_2)}

where m1 and m2 are the graidents and LaTeX Code: \\theta is the angle of intersection.

The reflection of the vector would just be LaTeX Code: 180^o-\\theta



Also can someone explain to me how the equation of the line AX+BY+C = 0 y=mx+c and the normals related ....
If you re-arrange and solve LaTeX Code: ax+by+c=0 for y...
LaTeX Code: by=-ax-c

LaTeX Code: y=-\\frac{a}{b}x-\\frac{c}{b}

so as you can see, the gradient of LaTeX Code: y=mx+k is m, while the gradient of LaTeX Code: ax+by+c=0 is LaTeX Code:  -\\frac{a}{b}

Also how does one fine a line perpendicular to another..
First find the gradient of one line by calculus or, better yet, doing it the way just above. Then use the formula LaTeX Code: (m_1)(m_2)=-1
Basically, for 2 lines to be perpendicular, their gradients must multiply to give -1.

For the general line above,
LaTeX Code: ax+by+c=0

LaTeX Code: y=-\\frac{a}{b}x-\\frac{c}{b}

The gradient for the normal of this line must be LaTeX Code: m_1=\\frac{-1}{m_2}

So, LaTeX Code: \\frac{-1}{-\\frac{a}{b}}=\\frac{b}{a}

Hence, LaTeX Code: y=\\frac{b}{a}x-\\frac{c}{b}
  Reply With Quote
Old Jun28-09, 08:31 AM                  #3
sundar0206

sundar0206 is Offline:
Posts: 9
Re: Lines intersect and reflect

Thanks for that post . I really appreciate the time you have taken to reply to my quesiton...

I understand how ax+by+c and y=mx+c are related. But then How is this related to the normals of the line..Is this somethin I have missed or not understoond
  Reply With Quote
Old Jun28-09, 09:20 AM                  #4
Mentallic

Mentallic is Offline:
Posts: 787
Re: Lines intersect and reflect

Hmm...

The only actual relationship one can give between any line and its normal is that their gradients multiply to -1

So if you have a line LaTeX Code: y=mx+k_1 the normal would be LaTeX Code: y=\\frac{-1}{m}x+k_2

I'm not sure what else there is to say. If you're still unsatisfied, please, try and elaborate your problem a little further and I'm sure you'll get more help
  Reply With Quote
image image
Reply

Tags
lines, reflecting lines
Thread Tools


Similar Threads for: Lines intersect and reflect
Thread Thread Starter Forum Replies Last Post
Inquiry: Find two lines in R^3 that are not parallel but do not intersect HF08 Calculus & Beyond 16 Feb17-08 09:45 PM
How and why does a mirror reflect light? pivoxa15 General Physics 1 Oct4-06 06:41 AM
Vectors - show that the lines intersect smn Precalculus Mathematics 11 Apr25-06 08:11 PM
Something to reflect on homology General Discussion 11 Jul21-04 11:07 AM
Two lines intersect at three points??? Mr. X General Math 2 May20-04 03:37 PM

Powered by vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. © 2009 Physics Forums
Sciam | physorgPhysorg.com Science News Partner
image
image   image