I have a set of points on a 3d plane A, the centroid of those points, and the normal vector A1 of the plane A and I also know the normal vector B1 of plane B.
How do I rotate the points on plane A to plane B which pivot at the centroid?
I have a transformation matrix as follows:
rmat = matrix([ x*x*C+c x*y*C-z*s x*z*C+y*s ],
[ y*x*C+z*s y*y*C+c y*z*C-x*s ]
[ z*x*C-y*s z*y*C+x*s z*z*C+c ])
newPoint = rmat * oldPoint
costheta = dot(A1, B1)/|A1 * B1|
c = costheta
s = sqrt(1-c*c)
C = 1-c
My results are rotated and translated.