When it's negative it always satisfies the first line of code. You don't have additional logic for negative values, so it uses the first one and goes past 180. 90 - 30 * 80 / 10 = -150?

And the parenthesis left of 90 is in the wrong place. It should be right of 90, otherwise you end up multiplying 90 x 80 to get 7200.
Actually it ends up being (90 - 3)*80 = 6960 = 19 revolutions plus +120 degrees or -240 degrees.

Amazing what one little typo will do to your numbers!

Last edited by Javelin; 06/26/19 02:19 AM.