PDA

View Full Version : math/physics question



Wulf
10-12-2001, 06:19 PM
Ok, if an object is thrown from a certain point, in a certain direction and with a certain speed and a constant set of forces accelerating it (ie. gravity, thrust, etc), how can I calculate the time that it will take for said object to intersect any given plane?

Nutty
10-13-2001, 07:42 AM
s = ut + 1/2 at^2

That is.

If the acceleration is constant, and you know the initial velocity, you can calculate the displacement relative to time.

t = time
u = initial velocity
a = acceleration (gravity)
s = displacement.

OR in code way.

final_pos = pos + (velocity * time) + (0.5 * accel * (time * time));

If you know the final position, ie. intersection point, then you should be able to solve for T.

Nutty

Wulf
10-13-2001, 01:44 PM
I probably should have said "calculate the time that it will take & intersection point" instead of just "calculate the time that it will take." The intersection point is unknown.

BTW, does anybody know if the position equation for a constant change in acceleration is

d = di + vi * t + 1/2 * a * t + 1/6 * b * t
b is change in acceleration

DFrey
10-13-2001, 03:02 PM
If the plane is static, then you simply use the plane as a constraint in solving the projectile equation. (That is, by solving for the location of the intersection, you will also get the time of the intersection). Though beware you may get 0, 1, 2, or infinite intersections, especially if you are really only interested in intersecting the projectile path with a planar facet.

[This message has been edited by DFrey (edited 10-13-2001).]