The easy way is by abandoning the built-in rotational aiming system and using the ship reader and a PID for elevation and azimuth of the cannon.
The hard way is by learning about how to work around Create’s sneaky Flicker Tally mechanic and using the CBC controls.
In either case the trajectory is calculated with this equation: