translation of orbital problem to C