So i have array that can look like this (javascript for the matter):
array = [{x: 0, y: 0}, {x: 1, y: 1}, {x: -4, y: 3}]
Each of the entrys has a x and y position. What i want to do is essentialy rotate those entrys 90 degrees in one direction.
Whats the simplest way to do this?
Basically you could something like this to perform a counter clockwise $90$ degrees rotation of center $(0,0)$. The point $(x,y)$ is transformed in $(-y,x)$.
One liner javascript code:
Drawing it should convince you. You could look at rotation matrices for solutions of broader problems with a different angle for example.