Hi, i am currently trying to shoot a ball off a cannonbarrel into the air controlled by using angles and a fixed speed, however it hasnt been working for me. formula that i have tried is
The *PI/180 needs to be inside the brackets with the 70, to ensure that the arguments of cos and sin are in radians.
You probably need a frameTime* in your line 3 as well: displacement and velocity don't have the same physical dimensions. If frameTime is large it will eventually be affected by gravity, too.
how do i know where true 0degrees is at? i think that's an issue with my program as i've read from some sites that 0 degrees points up, where as some says its the right
There is no such thing as "true 0 degrees". You are entirely free to measure it in whichever direction you like, as long as you are consistent. You shouldn't be looking up websites for this, you should be understanding the trigonometry. The only thing I can infer from your code is that you are measuring angles from the x-axis, which is perfectly fine.
The two things immediately wrong with your program are that the degrees-radians conversion factor should be inside the bracket with the 70 (lines 1 and 2) and the distance in the y direction is incorrectly related to velocity in line 3. These are maths problems, not C++.