# How to calculate a time to rendevouz an orbital object

I need to fly from one orbit to another to dock with station. So, station should be near the my position when I arrive to it's orbit.

I can find the station's position at time T, but how to find this time T?

I can calculate time for travel to start maneuver point plus time to travel station orbit, which gives me a future position, but flying to this position gives me another time, which gives another position, etc...

So, how to deal with it?

I heard about Lambert's problem. I found the working code that calculates needed theta angle, V1 and V2 using r1, r2, mu and needed t by Lambert's problem solver (Solver github.com/esa/pagmo/blob/master/src/AstroToolbox/Lambert.cpp). But I'm not sure that this is a thing that I'm seeking. How to find that time t of transfer? Should I use the time of Hohmann transfer from one orbit to another? And then just wait for returned theta angle before start the maneuver? Is it working only for circular orbits? What if I need to dock with station on Halo orbit?

This function returns needed angle for transfer by given time. But I need function that return transfer time by given current angle.

I don't know how to solve this kind of problems. I have two spacecrafts on different orbits with some random angle difference and I want that one spacecraft flied to orbit of another to the same location where another will be at arrival time. I don't need pork chop plot I just need a time and point where we will meet. I can perfectly predict position of any spacecraft at any time, but I don't know the time.

Update: this lambert's solver is not working (or I'm using the given velocities wrong, or my ship changes current velocity to needed for too much time when given velocity can be invalid already)

• Don't the successive iterations converge ?
– AJN
Oct 13 at 16:00
• I think about it. Is there a only one possible way? Oct 13 at 16:12
• Google "Lambert's problem". Google "pork chop plot". There are many questions and answers just here at Space.SE. There are many, many more examples across the internet. Oct 14 at 3:42
• @DavidHammen Okey, I found the working code that calculates needed theta angle, V1 and V2 using r1, r2, mu and needed t by Lambert's problem solver. But I'm not sure that this is a thing that I'm seeking. How to find that time t of transfer? Should I use the time of Hohmann transfer from one orbit to another? And then just wait for returned theta angle before start the maneuver? Is it working only for circular orbits? What if I need to dock with station on Halo orbit? Oct 15 at 8:53
• If you don't put all the parameters of the orbits you're testing with into your question, no one will be able to figure out why you're not getting the answer you expect, (or possibly, why you should expect the answer you are getting.) yesterday