# Calculating Y Angle

1. Dec 8, 2008

### MstWntd

1. The problem statement, all variables and given/known data

Hi All,

I have this code for my Games Project to calculate the Projectile maths for an arrow

[C++]
mPosition.y = ((pmVolYint * pmTime) + (pmAcc * (pmTime * pmTime) ) / 2) + 18 * sin(pmFAngle*(PI/180));
mPosition.x = ((pmVolYint * pmTime) +
((0.065* pmWind * pmArea) * (pmTime * pmTime) ) / 2) + 18 * cos(pmFAngle*(PI/180));

mVelocity.z = 0.065 * pmWind * pmArea * pmTime + pmVol;
pmTime += pmTimeInc;
[/C++]

What I would lik to do is calculate the new Y (Up/Down) roation produced over time pmTime.

2. Relevant equations

I dont have any

3. The attempt at a solution

mRotation.y = 18 * sin(pmFAngle*(PI/180));

and

mRotation.z = (pmAcc * (pmTime * pmTime) ) / 2) + 18 * sin(pmFAngle*(PI/180));

Please do help and any help is greatly appriecated.

Thanks.

2. Dec 9, 2008

### MstWntd

This isnt a home question..I just put it in here because its so basic..but in order to get my arrow to tilt as it moves I really need its new Angle..someone help!

3. Dec 9, 2008

### MstWntd

Is there something wrong in my post?

I have to get the behavoir of my game right by 3pm Thursday and I still have to do the documentation!

4. Dec 9, 2008

### turin

I don't think many people here want to try to interpret computer code. Sorry.

5. Dec 10, 2008

### MstWntd

oh, its same as a maths equation, i think. I'll change it :)

T= Time traveled
W = Wind
A = Area
F = Flight Angle
V= Volicity of Y
G = is the gravity
PI = pie
$$Y = ((V_{0} T) + (G(T^{2}) ) / 2) + 18sin(F(PI/180))$$

T= Time traveled
W = Wind
A = Area
F = Flight Angle
V= Volicity of Y
PI = pie

$$X = ((V_{0} T) + ((0.065 W A)(T^{2}) / 2) + 18cos(F(PI/180));$$

Ok, so yeah, how will i calculate the new X and Y angle as the arrow is flow over time?

6. Dec 10, 2008

### turin

I'm sorry. I still don't follow.

From your overall setup, I would assume:
- "time travelled" is like the number of ticks on a clock that occur after the arrow is shot.
- "volicity of y" is velocity in y-direction?
- "gravity" is the acceleration due to gravity (i.e. 9.8 m/s^2)
- "pie" is $\pi$, the ratio of circumference to diamater of a circle (and actually spelt as "PI", :>)
Does this look correct?

Please explain what you mean by:
- "wind" (is this a force or pressure?)
- "area" (area of what?)
- "flight angle" (I have no idea)
- "X" and "Y" - they look like Cartesian coordinates, but you are calling them angles ...?

The first part of the expressions for X and Y look like ordinary kinematic equations, but I don't understand the trig parts.

7. Dec 10, 2008

### MstWntd

Sorry, X and Y are indeed Cartesian coordinates.

wind and area are not a factor.

flight angle, is the inital Y angle.

I would know less then you about the equations used here, i ripped it off an example i found. :shy:

at the moment I am calculating the maxhight of the arrow and after it reachers that, i negate the current Y angle.

cheap hack, but yeah has the same effect in the end, however i wud rather have it more dynamic :)

8. Dec 12, 2008

### turin

Then why did you put them in your equations? We either need to understand what you mean by "A" and "W" (mmm, root beer), or you need to try some different equations.

What is a "Y angle"?

Huh? What effect? More dynamic than what? I should tell you that I still have no idea what we're talking about.