Reputation: 157
I had a similar question but although I had the help of the community I couldn't solve it.
I have following problem: A ball moves towards a moving line. I want to know WHEN the ball collides with the line.
My best attempt to solve it:
All variables:
f(x) ... The line of the ball movement
g(x) ... The line before it moved
g1(x) ... The line after it moved
g2(x) ... The line after it moved + the radius (when the ball center hits this line, the ball border hits g1(x)
A (Ax, Ay) ... First point of the line before it moved
A1 (A1x, A1y) ... First point of the line after it moved
B (Bx, By) ... Second point of the line before it moved
B1 (B1x, B1y) ... Second point of the line after it moved
Vc (Vcx, Vxy) ... Speed of ball
Va (Vax, Vay) ... Speed for point A
Vb (Vbx, Vby) ... Speed for point B
r ... Radius of the ball
t ... Time of collision
A1 = (Ax + Vax * t, Ay + Vay * t)
B1 = (Bx + Vbx * t, By + Vby * t)
g1: y1 = k1 * x + d1
(y = kx + d
)
k1 = (B1y-A1y)/(B1x-A1x)
(k = (dif between y)/(dif between x)
)
d1 = A1y - k1 * A1x
(d = y - kx
)
g2: y2 = k1 * x + d2
r = abs(d2 - d1)/sqrt(k1^2 + 1)
I solve it for d2
I build the equation for f(x)
f: y = k * x + d
k = Vcy/Vcx
d = Cy - k * Cx
f(x) = g2(x)
Microsoft Mathematics and my TI Nspire CX CAS are able to calculate every step EXCEPT step 8
Is there a easier way to do it?
Or do you know any programs that should be able to solve it?
(My old question: click me)
Upvotes: 2
Views: 132
Reputation: 4283
Shucks. Derive has been working for a minute. It never comes back from such a trip. Is it possible there is still an error? Or that the equation can't be solved algebraically?
Here's the equation it was trying to solve (for two minutes):
Let's break it up:
Solve
for t.
I just remembered how to do subscripts, sort of:
Upvotes: 1