Im creating animation of circle in JavaFX. A user inputs variables like angle and power of throw and my task was to create trajectory of this and make animation of thrown circle. Already I did trajectory and with that Im able to get final position of circle, but I still need to do animation of cricle trajectory. Im calculating the whole trajectory in loop and then draw curve.
Circle on the left is before throw and the right one is after this action. How can I animate this circle with trajectory already drawn? https://i.imgur.com/HlxQD8r.png
for(x = 0; x < Z; x=x+0.01){
y = x * Math.tan(angleRadians) - (gSpeed/mianownik) * Math.pow(x, 2); // some variables to calculate y position
y = 0 - y; //negation the real y position cause its kinda reverted
gc.strokeLine(x+10, y+100, x+10,y+100); // drawing line; +10 and +100 because (10, 100) is circle starting position
}
gc.fillOval(x,y+100,20,20); // drawing cricle after throw