Rotate points from one plane to another

1.4k Views Asked by At

I'm trying to create a algorithm that will rotate points given on plane 1 to plane 2.

I have found two different ways of doing this.

My question is ...

Why are the transformation matrices different for solution 1 solution 2? What am i Missing?

Solution 1

Plane 1
           X      Y      Z 
Pt A'   0.000   0.000   0.000
Pt B'   0.000   1.000   0.000
Pt C'   1.000   0.000   0.000

Va      1.000   0.000   0.000
Vb      0.000   1.000   0.000

X Axis =    YxZ
Y Axis =    Vb
Z Axis =    Plane Normal    

X Axis =    1.000   0.000   0.000
Y Axis =    0.000   1.000   0.000
Z Axis =    0.000   0.000   1.000

Plane 2
            X'         Y'        Z'
Pt A'   814925.0    818261.8    20.8
Pt B'   814926.9    818258.6    20.8
Pt C'   814920.9    818259.3    20.4

Va        -4.077    -2.439  -0.395
Vb         1.907    -3.194  0.032

X' Axis =   YxZ
Y' Axis =   Vb
Z' Axis =   Plane Normal        

X' Axis =   -56.417 -33.753 -5.461
Y' Axis =   1.907   -3.194  0.032
Z' Axis =   -1.339  -0.621  17.672


Transformation Matrix
         Fx1     Fy1     Fz1
Fx'1     X.X'    Y.X'   Y.X'
Fy'1     X.Y'    Y.Y'   Y.Y'
Fz'1     X.Z'    Y.Z'   Y.Z'

          Fx1     Fy1     Fz1
Fx'1    -0.855  -0.512  -0.083
Fy'1     0.513  -0.858   0.009
Fz'1    -0.075  -0.035   0.997

Final Transformation Matrix (Transpose of the one above)
           Fx1    Fy1     Fz1
Fx'1    -0.855   0.513  -0.075
Fy'1    -0.512  -0.858  -0.035
Fz'1    -0.083   0.009   0.997

Solution 2

Plane 1 Normal =     0x   +    0y   +    1z
Plane 2 Normal =  -1.339x + -0.621y + 17.672z

Rotation Axis = |N1| x |N2|
Rotation Axis = -0.421x +   0.907y +    0.000z

Cos Theta = A.B/|A|*|B|
Cos Theta = 0.99653

c = costheta      = 0.9965
s = sqrt(1-c*c)   = 0.0832
T = 1-c           = 0.0035

Rotation Matrix (Right Handed)      
xxT+c   xyT-zs  xzT+ys
yxT+zs  yyT+c   yzT-xs
zxT-ys  zyT+xs  zzT+c

 0.997  -0.001  0.075
-0.001   0.999  0.035
-0.075  -0.035  0.997

Rotation Matrix (Left Handed)       
xxT+c   xyT+zs  xzT-ys
yxT-zs  yyT+c   yzT+xs
zxT+ys  zyT-xs  zzT+c

 0.997  -0.001  -0.075
-0.001   0.999  -0.035
 0.075   0.035   0.997

Point Check (Graphical)

Original        
X (ft)  Y (ft)  Z (ft)
0.00    0.00    1.00
0.00    1.00    1.00
1.00    1.00    1.00
1.00    0.00    1.00

 Solution 1     
X (ft)  Y (ft)  Z (ft)
-0.075  -0.035  0.997
 0.437  -0.894  1.005
-0.418  -1.405  0.922
-0.931  -0.547  0.914

Solution  2 Left        
X (ft)  Y (ft)  Z (ft)
-0.08   -0.04   1.00
-0.08    0.96   1.03
 0.92    0.96   1.11
 0.92   -0.04   1.07
1

There are 1 best solutions below

0
On

Essentially, you’re looking for a $3\times3$ matrix $A$ with $\det A=1$ that maps a given line to another given line (the normals to the source and destination plane). There are many such matrices: given such a matrix, composing it with a rotation about the destination plane’s normal gives another. If you want a unique solution, you’ll have to add other conditions to the problem.