I have been able to create some nice mathematical formulas that describe the end position of the gate, based extension length and the different heading and pitch angles. Of course these equations are rather complex, with a lot of sine and cosine functions, so that makes them hard to solve by hand. So I think to do it with some smart computer program and that sort of works. But unfortunately this set of equations does not have a single solution, so a simple answer was not possible.
The next step I took is to implement these equations in a little tool that just tries to find the closest answer by trying a lot of different angles, etc. This worked rather well (and also rather fast), so I will be using this approximation for my gates later on.
Now the next step is to put some data for different aircraft types in the equations and see if I can create proper animations from that. I will be giving that a try over the next few days, but I think this is going to work fine.