rotation 360 degrees to 0 again

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By websterek

Hi! I’m looking for a way to change every full rotation (>=360) again to 0. I was trying with simple algorithm but maybe there is a built-in way or some good approach for this problem?

My simple solution gives me a few problems.


:bust_in_silhouette: Reply From: volzhs

I guess you need fmod

var degree = fmod(365.0, 360.0)  # result : degree = 5.0

perfect, thank you!

websterek | 2018-08-24 12:48