Science > Physics > need to know init velocity: know the angle, total time, start and end points, gravity
| Topic: |
Science > Physics |
| User: |
"Jeff W." |
| Date: |
09 Aug 2004 07:49:04 PM |
| Object: |
need to know init velocity: know the angle, total time, start and end points, gravity |
I'm working on this little game and I know a bunch of things about the
particle, except the initial velocity....which I need to calculate. I
know the following:
Initial angle
Time spent in the air
Start and end points
Gravity
Since the update loop in my code executes 100 times a second to ensure
it runs the same speed on all machines, I consider my units to be
pixels per update count, or pixels per hundredth of a second. It's
possible that the start/end points could be at the same level or at
different levels.
If anyone could give me a hand, I'd appreciate it. I keep getting
these huge values that make the particle fly off screen instantly.
.
|
|
| User: "Greg Neill" |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
09 Aug 2004 08:37:41 PM |
|
|
"Jeff W." <jeff@dark-techno.org> wrote in message
news:cbd806ff.0408091649.70e9d829@posting.google.com...
I'm working on this little game and I know a bunch of things about the
particle, except the initial velocity....which I need to calculate. I
know the following:
Initial angle
Time spent in the air
Start and end points
Gravity
Since the update loop in my code executes 100 times a second to ensure
it runs the same speed on all machines, I consider my units to be
pixels per update count, or pixels per hundredth of a second. It's
possible that the start/end points could be at the same level or at
different levels.
If anyone could give me a hand, I'd appreciate it. I keep getting
these huge values that make the particle fly off screen instantly.
Assuming that the x-coordinate is parallel to the ground
and gravity is a uniform vertical field, then from the
time in the air and the distance separating the initial
and final x positions you know the x-component of the
velocity:
vx = (x1 - x0)/T
The vertical position of the projectile as a function of
time and the initial y-component of the velocity, vy, is:
y(t) = y0 + vy*t - (1/2)*g*t^2
Plugging in your known 'air time', T, and final y position, y1,
then solving for vy you find:
vy = (y1 - y0)/T + (1/2)*g*T
Your initial angle will be constrained by the vx and vy
components of the initial velocity:
v = sqrt(vx^2 + vy^2)
angle = atan(vy/vx)
Be sure to take into consideration the possibility that
you might have negative velocity components in certain
situations; check the quadrant for the result of the
atan finction, or use an atan2 function.
.
|
|
|
|
| User: "Phil Holman" |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
09 Aug 2004 08:19:00 PM |
|
|
"Jeff W." <jeff@dark-techno.org> wrote in message
news:cbd806ff.0408091649.70e9d829@posting.google.com...
I'm working on this little game and I know a bunch of things about the
particle, except the initial velocity....which I need to calculate. I
know the following:
Initial angle
Time spent in the air
Start and end points
Gravity
Since the update loop in my code executes 100 times a second to ensure
it runs the same speed on all machines, I consider my units to be
pixels per update count, or pixels per hundredth of a second. It's
possible that the start/end points could be at the same level or at
different levels.
If anyone could give me a hand, I'd appreciate it. I keep getting
these huge values that make the particle fly off screen instantly.
Sounds like projectile motion: a = -9.8 m/s
Vy = -9.8t + Vyo
Height (y) = -4.9t^2 +
Vyo.t + yo
Horizontal distance (x)
= Vx.t
From the initial angle you can calculate the ratio of Vy to Vx and then
solve the system of equations to get the initial velocity Vo.
PH
.
|
|
|
| User: "Phil Holman" |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
09 Aug 2004 09:01:14 PM |
|
|
"Phil Holman" <philjud@earthlink.not> wrote in message
news:8oVRc.14813$cK.10713@newsread2.news.pas.earthlink.net...
"Jeff W." <jeff@dark-techno.org> wrote in message
news:cbd806ff.0408091649.70e9d829@posting.google.com...
I'm working on this little game and I know a bunch of things about
the
particle, except the initial velocity....which I need to calculate.
I
know the following:
Initial angle
Time spent in the air
Start and end points
Gravity
Since the update loop in my code executes 100 times a second to
ensure
it runs the same speed on all machines, I consider my units to be
pixels per update count, or pixels per hundredth of a second. It's
possible that the start/end points could be at the same level or at
different levels.
If anyone could give me a hand, I'd appreciate it. I keep getting
these huge values that make the particle fly off screen instantly.
Sorry about the format......
Sounds like projectile motion:
a = -9.8 m/s
Vy = -9.8t + Vyo
Height (y) = -4.9t^2 + Vyo.t + yo
Horizontal distance (x) = Vx.t
From the initial angle you can calculate the ratio of Vy to Vx and then
solve the system of equations to get the initial velocity Vo.
Thinking about this you probably have too much information i.e. if you
know g, the launch angle and the start and finish point, you can
determine everything else.
PH
.
|
|
|
|
|
| User: "Sam Wormley" |
|
| Title: Re: need to know init velocity: know the angle, total time, start andend points, gravity |
09 Aug 2004 09:26:26 PM |
|
|
"Jeff W." wrote:
I'm working on this little game and I know a bunch of things about the
particle, except the initial velocity....which I need to calculate. I
know the following:
Initial angle
Time spent in the air
Start and end points
Gravity
Trajectory-Projectile
http://scienceworld.wolfram.com/physics/Trajectory.html
http://scienceworld.wolfram.com/physics/Projectile.html
.
|
|
|
|
| User: "Jon Bell" |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
09 Aug 2004 08:34:31 PM |
|
|
In article <cbd806ff.0408091649.70e9d829@posting.google.com>,
Jeff W. <jeff@dark-techno.org> wrote:
I'm working on this little game and I know a bunch of things about the
particle, except the initial velocity....which I need to calculate. I
know the following:
Initial angle
Time spent in the air
Start and end points
Gravity
A general procedure that will sove any projectile motion problem is to
write down the general equations for both components of position (x and y)
and velocity (v_x and v_y), and solve for the unknowns (if it's
mathematically possible to do so).
x = x_0 + v_0*(cos theta_0)*t + (1/2)*a_x*t^2
v_x = v_0*(cos theta_0) + a_x*t
y = y_0 + v_0*(sin theta_0)*t + (1/2)*a_y*t^2
v_y - v_0*(sin theta_0) + a_y*t
Here I've used v_0*(cos theta_0) instead of v_0x, and v_0*(sin theta_0)
instead of v_0y, for the components of the initial velocity, since you
know initial angle; but I've left the final v_x and v_y as components.
You know a_x = 0 and a_y = -9.8 m/s^2 (assuming you don't have to worry
about air resistance). You say you know theta_0, t, x_0, y_0, x, and y.
That leaves v_x and v_y (the velocity components at impact) and v_0 (the
initial speed) as your unknowns. That's four equations for three
unknowns, which is not guaranteed to have a solution. It's an
overdetermined system of equations.
Decide which of your "knowns" doesn't really need to be known in advance,
make it an unknown, and solve the resulting system of four equations in
four unknowns.
--
Jon Bell <jtbellm4h@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
.
|
|
|
| User: "Jon Bell" |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
10 Aug 2004 02:56:11 PM |
|
|
In article <cf98n6$m6t$1@jtbell.presby.edu>,
Jon Bell <jtbelld8f@presby.edu> wrote:
x = x_0 + v_0*(cos theta_0)*t + (1/2)*a_x*t^2
v_x = v_0*(cos theta_0) + a_x*t
y = y_0 + v_0*(sin theta_0)*t + (1/2)*a_y*t^2
v_y - v_0*(sin theta_0) + a_y*t
Correction: the last equation should read
v_y = v_0*(sin theta_0) + a_y*t
so that it is similar to the second one.
--
Jon Bell <jtbellm4h@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
.
|
|
|
|
|
| User: "Ian Stirling" |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
09 Aug 2004 09:01:58 PM |
|
|
Jeff W. <jeff@dark-techno.org> wrote:
I'm working on this little game and I know a bunch of things about the
particle, except the initial velocity....which I need to calculate. I
know the following:
Initial angle
Time spent in the air
Start and end points
Work out horizontal velocity.
Now, work out total velocyty given horizontal component.
.
|
|
|
|
| User: "John C. Polasek" |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
10 Aug 2004 10:55:06 AM |
|
|
On 9 Aug 2004 17:49:04 -0700, (Jeff W.) wrote:
I'm working on this little game and I know a bunch of things about the
particle, except the initial velocity....which I need to calculate. I
know the following:
Initial angle
Time spent in the air
Start and end points
Gravity
Since the update loop in my code executes 100 times a second to ensure
it runs the same speed on all machines, I consider my units to be
pixels per update count, or pixels per hundredth of a second. It's
possible that the start/end points could be at the same level or at
different levels.
If anyone could give me a hand, I'd appreciate it. I keep getting
these huge values that make the particle fly off screen instantly.
If start and finish altitudes are the same, then
V0 = g * T/2 *1/sinA
because V0*sinA will reach zero at the top in T/2.
Mr. Dual Space
(If you have something to say, write an equation.
If you have nothing to say, write an essay).
.
|
|
|
|
| User: "Jeff W." |
|
| Title: Re: need to know init velocity: know the angle, total time, start and end points, gravity |
10 Aug 2004 02:17:34 PM |
|
|
Thanks, I appreciate all your help =)
.
|
|
|
|

|
Related Articles |
|
|