Thanks, that will come in handy.
Right now, I have run into a rather nasty problem completely unrelated with any math... The kost-datatypes and orbiter datatypes seem to have trouble getting along. Allthough the compiler doesn't complain about using kostElements and ELEMENTS interchangabely, Orbiter seems to mind a big deal and reacts with a just-in-time debug error and subsequent ctd.
The same happens even if I want to copy the types manualy (like, kostElements.e = ELEMENTS.e, same goes for the parameters). Orbiter seems unable to even convert a double into kost real, the same jit-debug error occurs. Any Idea what I'm missing?
there seems to be no problem with calling kost functions etc, but everytime I'm trying to get the orbital elements over from Orbiter to kost, disaster ensues...