Not sure of the best practice, but just try things. That’s the best way to get some knowledge/experience in it. There are a million different ways to do most things in programming. Just need to find one that works.
I would try shooting an invisible ball every time the Power or Angle is changed and then use that info to draw your prediction line. The rough ground does make it difficult to find trajectory without some practical means like this.