# projectile motion

This topic is 3285 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Is there any 3d projectile motion pseduocode available that gives user to input velocity acceleration and elevation angle?

##### Share on other sites
if you have a net velocity V, then just split it up into components:

vx = V * cos(phi) * cos(theta)
vy = V * sin(phi)
vz = V * cos(phi) * sin(theta)

Where theta is the direction that you're aiming about the plane and phi is the elevation from the plane.

##### Share on other sites

vx = V * cos(phi) * cos(theta)
vy = V * sin(phi)
vz = V * cos(phi) * sin(theta)

shouldn't it be

vx = V * cos(phi) * cos(theta)
vy = V * cos(phi) * sin(theta)
vz = V * sin(phi)

?

In the timestep area, I just have to add acceleration to velocity and then velocity to position right? for the z axis, what would be the standardised form of gravity equation?

##### Share on other sites
You may be interested in the video tutorial that I created here:

##### Share on other sites
Those forumas depend on what axis you consider to be "up" so whats right just depends ony our implementation. Some use y, soem use z so both are right.

velocity += acceleration
velocity += gravity
position += velocity

should give you the typical balistic path.

##### Share on other sites
Quote:
 Original post by mmakrzemYou may be interested in the video tutorial that I created here:http://www.marek-knows.com/downloadSection.php?Topic=Physics&pg=1#Physics10

Marek, every time you recommend people to download your tutorials, you also recommend to register up on your site and possibly pay money to you, for knowledge that is available in a much more comprehensive way in the internet or at public libraries. You probably know that yourself, and presumably based your videos on exactly such public and free information, right?

For example, this and those have a ton of valuable information and background knowledge about trajectories.

1. 1
2. 2
3. 3
4. 4
frob
11
5. 5

• 16
• 13
• 20
• 12
• 19
• ### Forum Statistics

• Total Topics
632172
• Total Posts
3004569

×