It's part of my assignment. Though, I keep getting different and negative numbers but I'm not sure why. I'm supposed to use the formula:
Where V = launch speed A = Angle (A is actually supposed to be theta) and g = gravity.
Instead of using meters, I used the feet conversion to go from Miles Per Hour to feet because the output has to be in feet. So I had to multiply the result by the number of feet in a mile. I also used the force of Earths gravity in feet (32.2). First I did the formula in Java by doing:
//Pretend that mySpeed[row] = 20 MPH and myAngle[col] = 25 degrees variable = (Math.pow(mySpeed[row],2) * Math.sin(2 * myAngle[col]) / 32.2) * 5280;
The output seems to be -17209. But I get 50,244.9 on the calc. And the debugger won't get that specific for me so I can't pinpoint where things go wrong. Can someone spot what I did wrong. I assume it's my parenthesis.