Figuring out an algorythm to get get the rotation from the time