I have written the following function for projectile motion of different force and angle, but it doesn\'t work properly. Where have I gone wrong? I want something like the A
The formulae you created for x- and y-displacement are both missing a time
factor in the first term. Below, I placed your code above and the correct code below, for comparison, so you can see exactly what you left out.
For X Displacement
(ball.getX()+10)*Math.cos(radians)+ ...
(ball.getX()+10)*time*Math.cos(radians)+ ...
For Y Displacement
(ball.getY()+10)*Math.sin(radians)+ ...
(ball.getY()+10)*time*Math.sin(radians)+ ...
I referenced Wikipedia's equation for displacement as a function of radians to answer your question.