Originally Posted by sundar0206
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

, to find if it intersects

simply solve these simultaneously. i.e. substitute

into the line equation.
Hence,
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,

Therefore the points of intersection are (1,1) and (2,4).
To find the angle at which the particle travelling along

'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).

At x=1,
So the gradient is 2 while the gradient of the line is...

comparing to y=mx+b where m is the gradient, hence, 3.
Now use the formula
where m
1 and m
2 are the graidents and

is the angle of intersection.
The reflection of the vector would just be
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

for y...
so as you can see, the gradient of

is m, while the gradient of

is
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

Basically, for 2 lines to be perpendicular, their gradients must multiply to give -1.
For the general line above,
The gradient for the normal of this line must be
So,
Hence,