- #1
gaate
- 4
- 0
I am making a java program and part of it is to graph the path of a projectile x vs y.
The problem i have is that when i use this equation, it messes up the rest of the graph, whenever tan of the angle is negative, so say for 45 degrees the program works fine, but for 43 degrees the graph is just a strait line.
It seems however that this equation would do this regardless of it being in a program. So my equation must be wrong. Here is is out of code.
H + (x * tan(a)) - ((9.8 * x^2) / (2 * (V * cos a)^2))
in code
points[count] = h + (count * tan(a)) - ((9.8 * Math.pow(count,2)) / (2 * Math.pow((tVel * cos(a)),2)));
What with my equation is off?
Also,
If anyone would be feeling Generous enough to help me test it out, just check some math, i would be forever gratefull.
http://www.mediafire.com/?r2e0e4ha57u13uq
The problem i have is that when i use this equation, it messes up the rest of the graph, whenever tan of the angle is negative, so say for 45 degrees the program works fine, but for 43 degrees the graph is just a strait line.
It seems however that this equation would do this regardless of it being in a program. So my equation must be wrong. Here is is out of code.
H + (x * tan(a)) - ((9.8 * x^2) / (2 * (V * cos a)^2))
in code
points[count] = h + (count * tan(a)) - ((9.8 * Math.pow(count,2)) / (2 * Math.pow((tVel * cos(a)),2)));
What with my equation is off?
Also,
If anyone would be feeling Generous enough to help me test it out, just check some math, i would be forever gratefull.
http://www.mediafire.com/?r2e0e4ha57u13uq