@-Fox_code- for the original.
I just replaced the - operator when rotating the y coordinate with a + operator (And edited the line drawing script slightly).