So, is this correct: The first two p's subtract the offset to regard the point not being the origin. Than the computation is done again and p's are added to re translate it back to the origin.
The array is four integers held to be a shape of a grid of 8 cells (two columns,) It's not really a rectangle.
I was playing around with the values (mirrored or not:)
xNew = -y
yNew = x
and got it working luckily. I find it confusing that the second set of additions uses the first set that subtracts. I think I've got it now but was hoping someone could do a simple explanation if there is anything else to explain!
The way that I got it working was I drew a circle with p.y in the center and a.y on the circumference with the difference being what I assumed to be the y. Likewise for the x values.
Thank you,
Josheir