Coding challenge

The following code
angle= 37.5

x1=100
y1=100

x2=100
y2=-100

x3=-100
y3=-100

x4=-100
y4=100

line(x1,y1,x2,y2)
line(x2,y2,x3,y3)
line(x3,y3,x4,y4)
line(x4,y4,x1,y1)
will draw a square, with corners given by the points $(x_1,y_1)$, $(x_2,y_2)$, $(x_3,y_3)$ and $(x_4,y_4)$. Write some code that will draw the square rotated clockwise by any angle supplied by the angle variable. You might want to review our lesson on 'Rotating a parabola' first.

Type your code here:


Lua reference

See your results here: