Register to reply

Trajectory, equation

by Iconate
Tags: equation, trajectory
Share this thread:
Iconate
#1
Mar3-10, 04:27 PM
P: 21
I have never taken any physics course before, but I am designing a game in which the projectile(bullet) is going to drop over time.

I want to know which equation do I use to calculate the position on a trajectory. Given that I have the angle, and initial velocity.

http://en.wikipedia.org/wiki/Trajectory

From this would it be the Derivation of the equation of motion as it is the only one I can see there that is returning a y value.

Secondly, if this is true, would the black trajectory here:

http://upload.wikimedia.org/wikipedi...linedthrow.gif

Represent the kind of output I'm going to see, since (at the moment) I am not incorporating any drag?

Thanks in advance
Phys.Org News Partner Mathematics news on Phys.org
Professor quantifies how 'one thing leads to another'
Team announces construction of a formal computer-verified proof of the Kepler conjecture
Iranian is first woman to win 'Nobel Prize of maths' (Update)
Gib Z
#2
Mar3-10, 07:48 PM
HW Helper
Gib Z's Avatar
P: 3,348
Yes the equation you found indeed gives the height of the trajectory if you know the horizontal displacement. You stated you know the angle and initial velocity, but to get the height you would need either the time is has been travelling or the displacement horizontally. If you have time rather than horiontal displacement, you need a different equation.

And yes, if you are not incorporating any drag it is true that a) The motion will be parabolic and b) the trajectories that reach higher peaks have a longer time of flight.
dsoltyka
#3
Mar7-10, 12:45 AM
P: 5
Oddly enough, I came here to ask a similar question.

I'm trying to implement a similar situation in a game, but I'm having issues coming up with a good formula.

If I have an object starting an an arbitrary point in 2d space (x,y), how can I calculate the trajectory angle needed in order to "throw" an object and ensure it lands at a second point in 2d space. In my scenario gravity is known, initial velocity is known, and the time it takes to get to the second point is irrelevant. I simply need to calculate the angle I need.

Any ideas?

Iconate
#4
Mar7-10, 02:46 AM
P: 21
Trajectory, equation

Yeah actually, after a lot of searching I came across this

http://babek.info/libertybasicfiles/...130/proj3d.htm

Implemented that in C++, works perfectly.
sjb-2812
#5
Mar7-10, 08:05 AM
P: 427
Quote Quote by dsoltyka View Post
Oddly enough, I came here to ask a similar question.

I'm trying to implement a similar situation in a game, but I'm having issues coming up with a good formula.

If I have an object starting an an arbitrary point in 2d space (x,y), how can I calculate the trajectory angle needed in order to "throw" an object and ensure it lands at a second point in 2d space. In my scenario gravity is known, initial velocity is known, and the time it takes to get to the second point is irrelevant. I simply need to calculate the angle I need.

Any ideas?

Basically, you have a set of simultaneous equations, one for y-displacement and one for x-displacement, and you can solve for independently. You can break the initial velocity into x and y compoments dependent on the angle of fire.
zgozvrm
#6
Mar9-10, 03:14 PM
P: 754
Quote Quote by dsoltyka View Post
Oddly enough, I came here to ask a similar question.

I'm trying to implement a similar situation in a game, but I'm having issues coming up with a good formula.

If I have an object starting an an arbitrary point in 2d space (x,y), how can I calculate the trajectory angle needed in order to "throw" an object and ensure it lands at a second point in 2d space. In my scenario gravity is known, initial velocity is known, and the time it takes to get to the second point is irrelevant. I simply need to calculate the angle I need.

Any ideas?
(Note that these formulas have the following assumptions: angles in degrees, distance in meters and that the acceleration of gravity is 9.8 m/s2)

Given the initial velocity Vi and the trajectory angle [itex]\alpha[/tex], you have horizontal and vertical components of the initial velocity:
Vix = Vi [itex]\times[/tex] cos([itex]\alpha[/tex]), Viy = Vi [itex]\times[/tex] sin([itex]\alpha[/tex])

Likewise, given the angle [itex]\beta[/tex] and distance D to the target, there is a horizontal and vertical displacement:
Dx = D [itex]\times[/tex] cos([itex]\beta[/tex]), Dy = D [itex]\times[/tex] sin([itex]\beta[/tex])

The time it takes for the projectile to cover the horizontal distance can be found by:
(1) t = [tex]\frac{D_x}{V_{ix}}[/tex]

The vertical offset over time t, can then be found by:
(2) Dy = [tex]V_{iy}\cdot t - 4.9 \cdot t^2[/tex]

In your case, the angle [itex]\alpha[/tex] is unknown and therefore, so are Vix and Viy, so substituting equation (1) into equation (2) gives us:
[tex]D_y = V_{iy} \cdot \frac{D_x}{V_{ix}}-4.9 \cdot \left( \frac{D_x}{V_{ix}} \right)^2[/tex]

[tex]D_y=\frac{V_{ix} \cdot V_{iy} \cdot D_x}{{V_{ix}}^2} - \frac{4.9 \cdot {D_{x}}^2}{{V_{ix}}^2}[/tex]

[tex]D_y=\frac{V_{ix} \cdot V_{iy} \cdot D_x - 4.9 \cdot {D_x}^2}{{V_{ix}}^2}[/tex]

[tex]D_y \cdot {V_{ix}}^2 = D_x \cdot V_{iy} \cdot V_{ix} - 4.9 \cdot {D_x}^2[/tex]

[tex]D_y \cdot {V_{ix}}^2 + 4.9 \cdot {D_x}^2 = D_x \cdot V_{iy} \cdot V_{ix} [/tex]

Squaring both sides, we get
(3) [tex]{D_y}^2 \cdot {V_{ix}}^4 \; + \; 9.8 \cdot D_y \cdot {D_x}^2 \cdot {V_{ix}}^2 \; + \; 24.01 \cdot {D_x}^4 = {D_x}^2 \cdot {V_{iy}}^2 \cdot {V_{ix}}^2 [/tex]

Now, we know that Vix2 + Viy2 = Vi2 and therefore Viy2 = Vi2 - Vix2

substituting into equation (3) gives us:
[tex]{D_y}^2 \cdot {V_{ix}}^4 \; + \; 9.8 \cdot D_y \cdot {D_x}^2 \cdot {V_{ix}}^2 \; + \; 24.01 \cdot {D_x}^4 = {D_x}^2 \cdot ({V_i}^2 \; - \; {V_{ix}}^2) \cdot {V_{ix}}^2 [/tex]

Multiplying out and rearranging, we have:
[tex]{D_y}^2 \cdot {V_{ix}}^4 \; + \; {D_x}^2 \cdot {V_{ix}}^4 \; + \; 9.8 \cdot D_y \cdot {D_x}^2 \cdot {V_{ix}}^2 \; - \; {D_x}^2 \cdot {V_i}^2 \cdot {V_{ix}}^2 \; + \; 24.01 \cdot {D_x}^4 = 0[/tex]

[tex]({D_y}^2 \; + \; {D_x}^2) \cdot {V_{ix}}^4 \; + \; (9.8 \cdot D_y \cdot {D_x}^2 \; - \; {D_x}^2 \cdot {V_i}^2) \cdot {V_{ix}}^2 \; + \; 24.01 \cdot {D_x}^4 = 0[/tex]

But, since Dx2 + Dy2 = D2, we have:
(4) [tex]D^2 \cdot {V_{ix}}^4 \; + \; (9.8 \cdot D_y \cdot {D_x}^2 \; - \; {D_x}^2 \cdot {V_i}^2) \cdot {V_{ix}}^2 \; + \; 24.01 \cdot {D_x}^4 = 0[/tex]

The equation (4) is a quadratic and Vix is the only unknown variable.

Remember that for quadratics of the form ax2 + bx + c = 0, we solve for x by using the quadratic formula:
[tex]x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}[/tex]

In your case,
[tex]x = {V_{ix}}^2[/tex]

[tex]a = D^2[/tex]

[tex]b = 9.8 \cdot {D_x}^2 \cdot D_y - {D_x}^2 \cdot {V_i}^2[/tex]

[tex]c = 24.01 \cdot {D_x}^4[/tex]


Solving the quadratic equation is easier done in parts: We already have determined a, b, & c. The value under the radical sign of the quadratic formula (b2 - 4ac) is known as the determinant. Let's call "d" the square root of the determinant. So now you'll have to solve for d:
[tex]d = \sqrt{b^2 - 4ac}[/tex]

and then plug the rest of the numbers into each of the following equations:

[tex]{V_{ix}}^2 = \frac{-b + d}{2a}[/tex] and
[tex]{V_{ix}}^2 = \frac {-b - d}{2a}[/tex]

and solve for [tex]V_{ix}[/tex] in each case.

Call the results [tex]V_{ix1}[/tex] and [tex]V_{ix2}[/tex]


Having solved for Vix, it is a simple matter to find the required trajectory angle (note that for all angles except 45 degrees, there exists two trajectory angles to reach your target - provided nothing is in the way of one or both of the calculated trajectories):

[tex]\alpha = cos^{-1}\left( \frac{V_{ix1}}{V_i} \right)[/tex]
or
[tex]\alpha = cos^{-1}\left( \frac{V_{ix2}}{V_i} \right)[/tex]
zgozvrm
#7
Mar10-10, 10:53 AM
P: 754
Quote Quote by zgozvrm View Post
[tex]a = D^2[/tex]

[tex]b = 9.8 \cdot {D_x}^2 \cdot D_y - {D_x}^2 \cdot {V_i}^2[/tex]

[tex]c = 24.01 \cdot {D_x}^4[/tex]


Solving the quadratic equation is easier done in parts: We already have determined a, b, & c. The value under the radical sign of the quadratic formula (b2 - 4ac) is known as the determinant. Let's call "d" the square root of the determinant. So now you'll have to solve for d:
[tex]d = \sqrt{b^2 - 4ac}[/tex]

and then plug the rest of the numbers into each of the following equations:

[tex]{V_{ix}}^2 = \frac{-b + d}{2a}[/tex] and
[tex]{V_{ix}}^2 = \frac {-b - d}{2a}[/tex]

and solve for [tex]V_{ix}[/tex] in each case.

Call the results [tex]V_{ix1}[/tex] and [tex]V_{ix2}[/tex]


Having solved for Vix, it is a simple matter to find the required trajectory angle (note that for all angles except 45 degrees, there exists two trajectory angles to reach your target - provided nothing is in the way of one or both of the calculated trajectories):

[tex]\alpha = cos^{-1}\left( \frac{V_{ix1}}{V_i} \right)[/tex]
or
[tex]\alpha = cos^{-1}\left( \frac{V_{ix2}}{V_i} \right)[/tex]
As an example, suppose your target lies 100m away at an angle (alpha) of 36.8699 degrees uphill. Also, suppose your projectile is an arrow with an initial speed of 75 m/s. You need to find the angle of trajectory (beta) needed in order to hit the target.

So, we start with the following values:
D = 100
alpha = 36.8699
Vi = 75


First, we need to determine the horizontal and vertical offsets to our target:
Dx = D x cos(alpha) = 100 x cos(36.8699) = 80
Dy = D x sin(alpha) = 100 x sin(36.8699) = 60

Now, we can find a, b, c, & d:

[tex]a = D^2 = 100^2 = 10,000[/tex]
[tex]b = 9.8 \times {D_x}^2 \times D_y - {D_x}^2 \times {V_i}^2 = -32,236,800[/tex]
[tex]c = 24.01 \times {D_x}^4 = 983,449,600[/tex]

[tex]d = \sqrt{b^2 - 4ac} = 31,620,773.080998[/tex]


Solve for the 2 equations:

[tex]{V_{ix1}}^2 = \frac{-b + d}{2a}[/tex] and

[tex]{V_{ix2}}^2 = \frac {-b - d}{2a}[/tex]:



[tex]{V_{ix1}}^2 = \frac{-b + d}{2a} \approx 3192.8787[/tex]

and

[tex]{V_{ix2}}^2 = \frac {-b - d}{2a} \approx 30.8013[/tex]


Take the square roots:

[tex]V_{ix1} \approx 56.5056[/tex]

and

[tex]V_{ix2} \approx 5.5499[/tex]



Finally, determine the angles:

[tex]\alpha_1 = \cos^{-1} \left( \frac{V_{ix1}}{Vi} \right) \approx 41.1136^\circ[/tex]

and

[tex]\alpha_2 = \cos^{-1} \left( \frac{V_{ix2}}{Vi} \right) \approx 85.7563^\circ[/tex]


Register to reply

Related Discussions
Principles of projectile motion and kinematics homework Introductory Physics Homework 1
Trajectory and parametric equation Introductory Physics Homework 2
Possible to take a trajectory from (x,y,t) and get a trajectory in phase space (q,p) Classical Physics 4
Trajectory equation needed Classical Physics 0
Special Trajectory Equation - Solving for T Calculus & Beyond Homework 0