Here is a simple examle of aiming a cannon/rocket using adjoint.
Sample program is written in matlab and uses automatic differentiation to compute the derivatives.
To understand the concept read the GG_MSc.pdf --> Chapter4: Adjoint and Appendix A.
Warm thanks to Łukasz Łaniewski-Wołłk.