I am looking for some performant algorithm for a rotation of multiple points in $\mathbb{R}^2$ (and maybe also $\mathbb{R}^3$ with one coordinate zero) around the origin.
Full story: I want to draw a texture on a quad plane along some line, rotated to the direction of the line. I know how to perform the translation beside the rotation.
If you already know the angle, you can build a rotation matrix or a quaternion/complex number using that for each point.
However, what I need is just a transformation between two direction vectors in the special case where the source direction is up $\vec{s}=\pmatrix{0\\1}$. The destination direction can be arbitrary and the vector does not necessarily have to be normalized ($\lvert\vec{d}\rvert \not=1 $).
Can it be done by getting the normalized unit vector $\vec{u_d} = \frac{\vec{d}}{\lvert\vec{d}\rvert} = \frac{\pmatrix{x\\y}}{\sqrt{x^2+y^2}}$ and just using the coordinates as $\sin$ / $\cos$ in a rotation matrix?
Since the source direction is up instead of along the x-axis, I guess $-\sin = x$ ; $cos = y$ of the normalized destination vector.
Would the thoughts above work? Is there any more performant way to do a rotation directly avoiding both, square root and sin/cos (e.g. using complex numbers or quaternions)? How else would I achieve what I want?