Synodic Period Calculator
Why "opposition" doesn't happen every year
Synodic period is the time between successive similar configurations of two orbiting bodies - like successive oppositions of a planet as seen from Earth - and differs from each body's own individual orbital period, since it accounts for both bodies moving simultaneously.
Worked example
For Earth (365.25-day orbit) and Mars (687-day orbit):
1/T(synodic) = |1/365.25 - 1/687|
T(synodic) = 779.88 days
This result closely matches the real, well-documented Earth-Mars synodic period of approximately 780 days (a little over 2 years) - this is exactly why Mars oppositions, the best times for observing and launching missions to Mars, occur roughly every 26 months rather than every single year.