• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Help with physics

## Recommended Posts

Hi all ! I want my player to throw an object at an exact location (with a motion along a parabola). The problem is, I need to find the velocity needed... I have the start location, the hit location, the acceleration (only gravity here)... but I also need the time to be able to find the value of the velocity (maybe i''m wrong here) !
  vHitLocation = vStartLocation + (vVelocity * fTime) + (vGravity * (fTime*fTime) * 0.5f); vVelocity = ?? 
Do you have any idea on how i could proceed ?

##### Share on other sites
Hum i forgot something... I know the angle at wich my object is thrown...
  vHitLocation = vStartLocation + (vDirection * fSpeed * fTime) + (vGravity * (fTime*fTime) * 0.5f);fSpeed = ??

Much better... Still I don''t know how I could find the value of fTime and fSpeed... they are both dependant one on the other
I''m sure I''m doing something wrong...

##### Share on other sites
well, I am thinkin about this, do you by any chance know the maximum height this object achieves, b/c if you do then you can calculate air-time, and therefor total time, and therefore velocity.

##### Share on other sites
Here''s my solution:

The path of a projectile can be modeled by the parametric equtations:

x_coordinate(time) = original_velocity * cos(theta) * time

and

y_coordinate(time) = original_height + (original_velocity * sin(theta)* time) - acceleration_due_to_gravity * time^2

The graph of these equations produces the trajectory of the projectile.

The acceleration due to gravity is based on the measurement system, metric is 9.8 m/(s^2) while english is 16 ft/(s^2).

Assuming you only have two unknowns, and that they appear in both equations, finding those unknowns is a simple matter of substitution.

In the case of BobJelly, all you have to do is substitute the values you know and solve for time, which will be in terms of the original velocity.

Substitution of that value back into the second equation produces a one value equation with the only variable being the original velocity.

The only thing that now remains is the trivial proceeding of solving the second equation for the original velocity and there you go.

That should do just about do it, hope I explained it well enough.

Peace out.

##### Share on other sites
I'm following the exact approach as Wizardry here. I've derived the final answer so you don't have to do as much work.

Lets see, you *know* the following:

start (throw) position (x0, y0)
end (hit) position (x1, y1)
lets say x is positive to the right, y positive up.
start angle, call it theta0 (in radians), measured from horizontal
gravity (-g in y direction)

You want to find the following:

tv = throwing velocity
th = time of hit

Your projectile motion path is given by these two scalar equations:

x(t) = x0 + tv*cos(theta0)*ty(t) = y0 + tv*sin(theta0)*t - g*t*t/2

Of course, you could write it as the two vector equations, with x acceleration component being 0.

The time, t, is measured from the time of the throw---so that the time of the throw is t = 0.

At the time of hitting your target, (time = th), you have

x(th) = x1 = x0 + tv*cos(theta0)*thy(th) = y1 = y0 + tv*sin(theta0)*th - g*th*th/2

There are two unknowns, th and tv. You have to solve the last two equations simulataneously. Start by solving the first equation for tv:

tv = (x1-x0)/(th*cos(theta0))

Then rewrite the second equation

y1 = y0 + (x1-x0)*sin(theta0)*th/(th*cos(theta0)) - g*th*th/2

Simplifying (note that th drops out of second term and
sin/cos = tan),

y1 = y0 + (x1-x0)*tan(theta0) - g*th*th/2

Or,

g*th*th/2 = y0-y1 + (x1-x0)*tan(theta0)

Solving for th,

th = sqrt((2/g) * (y0-y1 + (x1-x0)*tan(theta0)))

Take the positive square root since negative time isn't physically consistent here. If the discreminant of the sqrt term is negative then it means you *cannot* hit the target for the given throwing angle (i.e., you cannot hit a target at a higher position if object is thrown horizontally).

Then, from the earlier equation

tv = (x1-x0)/(th*cos(theta0))

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Edited by - grhodes_at_work on June 29, 2001 4:26:56 PM

##### Share on other sites
Found a couple of inconsistencies in Wizardry''s post:

quote:
Original post by Wizardry
y_coordinate(time) = original_height + (original_velocity * sin(theta)* time) - acceleration_due_to_gravity * time^2

You need to divide your last term by 2 so that:
y_coordinate(time) = original_height + (original_velocity * sin(theta)* time) - (acceleration_due_to_gravity * time^2)/2

quote:
Original post by Wizardry
The acceleration due to gravity is based on the measurement system, metric is 9.8 m/(s^2) while english is 16 ft/(s^2).

Actually, in English units its roughly 32 ft/(s^2), .

quote:
Original post by Wizardry
Peace out.

Yes, peace.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

##### Share on other sites
What do you mean by "English" units? We use metric in Britain.

##### Share on other sites
quote:
Original post by python_regious
What do you mean by "English" units? We use metric in Britain.

Oops. I'm using the phrase "English Units" as we use it in America. Really it is the "U.S. Customary System of Units," which uses the avoidupois system of weights. Its related to the British Imperial system. When you really get down to it this is a bit complicated! The web page below provides some details, I guess:

http://www.encyclopedia.com/printablenew/04129.html

Anyway, regardless of the fact that you use the Metric system in Britain, apparently the phrase "English Units" refers always to use use of pounds, ounces, tons for weight, pound-force for force, foot per second squared for acceleration, inch, foot, yard for distance, etc. The thing that has changed over time is that now the basic "English" units are now actually defined in *terms* of Metric units (e.g., a yard is now defined to be some fractional number of meters) when they used to be defined some other way. Its strange. Here is a web page that compares the units of English and Metric units.

http://www.essex1.com/people/speer/units.html

This was actually a fairly fascinating question! I did some searching to reply, and I may still have some things wrong. I certainly hope you didn't take offense in my original post----I believe I did use the term correctly.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Edited by - grhodes_at_work on June 29, 2001 7:19:46 PM

##### Share on other sites
No offense taken We usually call that the imperial system, it''s the first time I''ve heard it called the english system...

##### Share on other sites
Growing up in a former British colony, we were taught both the Imperial and Metric systems, and familiarized with both the terms "Imperial" and "English". Funny the British don''t teach that, since our curriculum is modeled exactly after the British (we even accept London and Cambridge GCEs).

• ### Forum Statistics

• Total Topics
628288
• Total Posts
2981846

• 11
• 10
• 10
• 11
• 17