added calculation of periapsis - still a bit buggy since peri > ||pos||