Rotate points from one plane to another












0












$begingroup$


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









share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    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









    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      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









      share|cite|improve this question









      $endgroup$




      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






      transformation 3d rotations plane-geometry






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Nov 30 '15 at 16:07









      T ChaT Cha

      1




      1






















          1 Answer
          1






          active

          oldest

          votes


















          1












          $begingroup$

          Essentially, you’re looking for a $3times3$ 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.






          share|cite|improve this answer









          $endgroup$














            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "69"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1553365%2frotate-points-from-one-plane-to-another%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1












            $begingroup$

            Essentially, you’re looking for a $3times3$ 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.






            share|cite|improve this answer









            $endgroup$


















              1












              $begingroup$

              Essentially, you’re looking for a $3times3$ 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.






              share|cite|improve this answer









              $endgroup$
















                1












                1








                1





                $begingroup$

                Essentially, you’re looking for a $3times3$ 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.






                share|cite|improve this answer









                $endgroup$



                Essentially, you’re looking for a $3times3$ 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.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Nov 30 '15 at 18:16









                amdamd

                31.7k21052




                31.7k21052






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Mathematics Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1553365%2frotate-points-from-one-plane-to-another%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    Npm cannot find a required file even through it is in the searched directory