How to "rotate" points through 90 degree?
No: replace $(x, y)$ with $(-y, x)$. That will rotate 90 degrees counterclockwise about the origin.
What you proposed will flip everything around a 45-degree line that runs from southeast to northwest.
BTW: To rotate clockwise, replace $(x, y)$ with $(y, -x)$.