Proof of Rotation Rule for a $90^\circ$ Rotation About the Origin I tried to prove the following rules algebraically: $90$ degree rotation. $(x,y)\to(-y,x)$:

I got 2 results at the end. However, I can't come up with a rigorous way to eliminate one of them (maybe this can be done using some mathematical definitions?). Furthermore, I wonder if it's possible to incorporate the fact that the rotation is counterclockwise into the proof itself, thus the proof will only give 1 result?
 A: There are a few ways to check the orientation (let's say you would like to have $v_1$ turned to $v_2$ counterclockwise).
Method 1. Check that $\det(v_1,v_2)>0$, namely $\left|\begin{array}{cc}x&y\\ -y&x\end{array}\right|>0.$
Method 2. Use complex numbers: multiplying by $i$ means a counterclockwise rotation by $90^\circ$.
$$i(x+iy) = -y+ix$$
Method 3. Use polar coordinates: Let $(x,y)=(r\cos\theta,r\sin\theta).$ Then you want $$\left(r\cos\left(\theta+\frac{\pi}2\right),r\sin\left(\theta+\frac{\pi}2\right)\right)$$
$$=\left(r\cos\left(\frac{\pi}2-(-\theta)\right),r\sin\left(\frac{\pi}2-(-\theta)\right)\right)$$
$$=(r\sin(-\theta),r\cos(-\theta))=(-r\sin\theta,r\cos\theta)=(-y,x).$$
A: Please note that your proof is somewhat incomplete.

$$\frac{P_y'-0}{P_x'-0}=-\frac{x}{y} \quad \Rightarrow \quad (P_x', P_y')=(-y, x) \, \text{ or } \, (y,-x)$$

is not necessarily true because $(-2y, 2x)$, $(-3y, 3x)$ , ... also satisfy the equation.

Let $P=(a,b)$ and $P'=(a',b')$. According to the definition of rotation around the origin, when a point is rotated around the origin, its distance from the origin remains the same. So we have$$d_{P'O}=d_{PO}$$ $$\Rightarrow \quad \sqrt{(a'-0)^2+(b'-0)^2}=\sqrt{(a-0)^2+(b-0)^2}$$ $$\Rightarrow \quad a'^2+b'^2=a^2+b^2.$$Let $l$ be the line passing through the points $(0,0)$ and $P=(a,b)$, so its equation must be $y=\frac{b}{a}x$. Since the angle of the rotation is $90^{\circ }$, the point $P'=(a', b')$ must lie on the line perpendicular to the line $l$, so the point $P'=(a', b')$ lies on the line $y=-\frac{a}{b}x$ and so $b'=-\frac{a}{b}a'$. So we have$$a'^2+ (-\frac{a}{b}a')^2= a^2+b^2$$ $$\Rightarrow \quad a'=\sqrt{b^2}=\pm b.$$Thus, according to the angle convention, the coordinates of the rotated point $P'$ is$$\begin{cases}P'=(-b, a) & \text{ if the rotation is counterclockwise} \\ P'=(b, -a) & \text{ if the rotation is clockwise} \end{cases}.$$

Addendum
Please note that mathematics conventions are not usually, though depending on the context, formulated mathematically. For example, it is a convention that positive real numbers lie to the right of the origin and negative real numbers lie to the left, and no one defines the "right" and "left" of the origin in terms of mathematical concepts.
A: Maybe the other answers posted are what you're looking for, but I thought of it in simpler terms. $(-y,x)$ and $(y,-x)$ are both the result of $90$ degree rotations, just in opposite directions. Which is clockwise and which is counterclockwise?
You can answer that by considering what each does to the signs of the coordinates.
Note that a $90$ degree CCW rotation takes a point in quadrant $1$ to quadrant $2$, quadrant $2$ to quadrant $3$, etc. The possibilities are:
$(+,+)\longrightarrow(-,+)$
$(-,+)\longrightarrow(-,-)$
$(-,-)\longrightarrow(+,-)$
$(+,-)\longrightarrow(+,+)$
You can see that $(x,y)\longrightarrow(-y,x)$ is the answer that affects signs in those ways. Similar analysis would work if the initial point was on an axis.
A: Embed it to a three dimensional plane and use cross product,
$$\begin{bmatrix} x \\ y  \\ 0 \end{bmatrix} \times \begin{bmatrix} -y \\ x  \\ 0 \end{bmatrix} = \begin{bmatrix}  0 \\ 0 \\ x^2 + y^2\end{bmatrix}$$
It point upwards, it is clockwise.
$$\begin{bmatrix} x \\ y  \\ 0 \end{bmatrix} \times \begin{bmatrix} y \\ -x  \\ 0 \end{bmatrix} = \begin{bmatrix}  0 \\ 0 \\ -(x^2 + y^2)\end{bmatrix}$$
It points downwards, it is anti-clockwise.
A: $P(x, y)$ in $xy-$coordinates is equivalent to $P[r, θ]$ in polar coordinates.
Their relations are:-
(1) $ r= \sqrt {x^2+ y^2}$;
(2) $x = r \cos \theta$
(3) $y = r \sin⁡ \theta \quad $ where $θ$ is the inclination of r w.r.t. the positive $x-$axis.

After a rotation (anticlockwise) of $90^0$, the image is at $(x', y') = [r, (90^0 + θ)]$.
Then,   $x' = r \cos (90^0 + θ) = – r \sin θ = –y$
$y' = r \sin [180^0 – (90^0 + θ) ] = r \cos θ = x$.
∴    The coordinates of the image is $(x', y') = (–y, x)$
