small driving improvements

Caching constants, simplifying equations and more accurate stop.

code is untested, just wrote down what came to my mind
(we're only using the create-parts of the open-code)

switching from float to double may enable code to calculate large distances

greetings from Austria