I have 100 points on $z=0$ plane. I want to rotate those points, such that they lie on any plane $P(a,b,c,d)$, preserving distances.
Hence, I need a rotation matrix.
For instance, if my points are $(2,5,0)$, $(4,4,0)$, $(1,3,0)$ and $(3,5,0)$, how do I rotate them and put them onto $x + 3y - z + 1 = 0$ plane?
This is what I have tried:
First, I have calculated the angle between the normal vector of $P$ and all the normal vectors of $x=0$, $y=0$ and $z=0$ plane
$(1,0,0)$, $(0,1,0)$, $(0,0,1)$
Let us refer to those angles as $\alpha$, $\beta$ and $\theta$ respectively.
Now, I rotate my points $\alpha$ around $x-axis$, $\beta$ around $y-axis$ and $\theta$ around $z-axis$.
I think my approach is wrong. Distances are preserved but the new plane is not the plane I want.
To expand on my earlier comment, the approach I suggested does work and is relatively straightforward. See the plots produced by the Matlab script below.
