Desmos construction : https://www.desmos.com/calculator/ftar8iueb0
As far as I understand the rotation of coordinate system formula, it is supposed to provide, for a fixed point in space $P(x,y)$ the new coordinates $(x', y')$ of $P$ in a coordinate system rotated ( clockwise) by an angle$\theta$.
One important thing , it seems to me, is that the formula is not supposed to move point $P$ in the underlying " fixed" or absolute space, but simply to provide a new representation of $P$'s location, with respct to the new ( rotated system).
Under theses assumptions, I thought I was entitled to infer that if I created in Desmos a point $P=(a,b)$ and then, using the rotation formula:
$$X(x,y)= x \cos \theta + y \sin \theta$$
$$ Y(x,y)= y \cos \theta - x \sin \theta$$
the point $P'= (X(a, b), Y(a,b)), $
I would see the two points coincide perfectly ( for after all, $P'$ is nothing more than a new representation of point $P$. )
But what I observe does not confirm my prediction : namely I see $P'$ rotating counterclockwise on a circle of center $0$ and of radius $OP$ .
Are my assumptions erroneous? oris it my reasoning from these assumptions?



The main issue here is that Desmos has a "default" coordinate system with the first coordinate assigned to a horizontal axis pointing to the right and the second coordinate assigned to a vertical axis pointing up. When you type something like $(X(a,b),Y(a,b))$, you will get a point plotted $X(a,b)$ units to the right of the default vertical axis and $Y(a,b)$ units above the default horizontal axis.
So your point $P'$ is a point at new coordinates plotted on the old coordinate system.
If you want to arrive at the same point using the new coordinates, you need to plot that point in the rotated coordinate system, not in the unrotated coordinates.
I don't know how to get Desmos to literally use a different coordinate system than its usual one when plotting points. But if you take a vector approach to the coordinate system, it is relatively easy to get the effect you want.
Let $e_1$ be a unit length vector parallel to the rotated $x$ axis and pointing in the positive direction of the rotated $x$ axis. Let $e_2$ be a unit length vector parallel to the rotated $y$ axis and pointing in the positive direction of the rotated $y$ axis. Then the linear combination of vectors $Xe_1 + Ye_2$ is a vector from the origin of the rotated coordinate system to the point with coordinates $(X,Y)$ in the rotated coordinate system.
In your Desmos plot, $e_1$ has coordinates $(\cos(R),\sin(R))$ and $e_2$ has coordinates $(-\sin(R),\cos(R))$. To plot a point with coordinates $(X,Y)$ in the rotated system, we need to start at the origin, move $X$ units in the rotated $x$ direction (that is, in the direction of $e_1$) and $Y$ units in the rotated $y$ direction (that is, in the direction of $e_2$). We get this movement via the linear combination of vectors
$$ X e_1 + Y e_2. $$
There does not seem to be a natural way to work with vectors in Desmos as far as I have discovered, but it does let you "multiply" a point by a scalar and "add" two points together, much like a linear combination of vectors. So the notation $X(a,b) e_1 + Y(a,b) e_2$ plots a point at the same position in the plane as $P$, just as desired. This Desmos graph demonstrates how it works.