Absolute value of rotation of a point around a line in 3D












0












$begingroup$


am struggling for hours with turning something that already works perfectly in 2D, into 3D space. Really hope someone can help…



The task is to determine the absolute rotation of a point around the coordinate system so that rotation can then be applied to another point.
In 2D you do that with simple atan2(X, Y) that gives the angle which then can be applied to a point by rotating it around the origin (0,0).



But how would I do exactly the same in 3D space?



I know the procedure to compute the angle between two vectors (v1, v2):
arccos( dot(v1, v2) / (magnitude(v1)*magnitude(v2)) )



However since I have only the input vector, I cannot use this. I would need an "origin vector" like [0,0] in 2D. Unfortunately the procedure fails when a vector is [0, 0, 0] (not surprising as it results in computing arccos of 0 / 0).



Does someone have an idea?



As additional information: I do know the normal vector of a plane where the point is found in but again I have the same problem that this normal vector does not contain an orientation,



Huge thanks in advance!










share|cite|improve this question









$endgroup$












  • $begingroup$
    Well, I'd recommend using either matrix rotations with Euler angles, or quaternions. Quaternions have a theoretical and practical advantage: no gymbal lock.
    $endgroup$
    – Adrian Keister
    Jan 28 at 17:04
















0












$begingroup$


am struggling for hours with turning something that already works perfectly in 2D, into 3D space. Really hope someone can help…



The task is to determine the absolute rotation of a point around the coordinate system so that rotation can then be applied to another point.
In 2D you do that with simple atan2(X, Y) that gives the angle which then can be applied to a point by rotating it around the origin (0,0).



But how would I do exactly the same in 3D space?



I know the procedure to compute the angle between two vectors (v1, v2):
arccos( dot(v1, v2) / (magnitude(v1)*magnitude(v2)) )



However since I have only the input vector, I cannot use this. I would need an "origin vector" like [0,0] in 2D. Unfortunately the procedure fails when a vector is [0, 0, 0] (not surprising as it results in computing arccos of 0 / 0).



Does someone have an idea?



As additional information: I do know the normal vector of a plane where the point is found in but again I have the same problem that this normal vector does not contain an orientation,



Huge thanks in advance!










share|cite|improve this question









$endgroup$












  • $begingroup$
    Well, I'd recommend using either matrix rotations with Euler angles, or quaternions. Quaternions have a theoretical and practical advantage: no gymbal lock.
    $endgroup$
    – Adrian Keister
    Jan 28 at 17:04














0












0








0





$begingroup$


am struggling for hours with turning something that already works perfectly in 2D, into 3D space. Really hope someone can help…



The task is to determine the absolute rotation of a point around the coordinate system so that rotation can then be applied to another point.
In 2D you do that with simple atan2(X, Y) that gives the angle which then can be applied to a point by rotating it around the origin (0,0).



But how would I do exactly the same in 3D space?



I know the procedure to compute the angle between two vectors (v1, v2):
arccos( dot(v1, v2) / (magnitude(v1)*magnitude(v2)) )



However since I have only the input vector, I cannot use this. I would need an "origin vector" like [0,0] in 2D. Unfortunately the procedure fails when a vector is [0, 0, 0] (not surprising as it results in computing arccos of 0 / 0).



Does someone have an idea?



As additional information: I do know the normal vector of a plane where the point is found in but again I have the same problem that this normal vector does not contain an orientation,



Huge thanks in advance!










share|cite|improve this question









$endgroup$




am struggling for hours with turning something that already works perfectly in 2D, into 3D space. Really hope someone can help…



The task is to determine the absolute rotation of a point around the coordinate system so that rotation can then be applied to another point.
In 2D you do that with simple atan2(X, Y) that gives the angle which then can be applied to a point by rotating it around the origin (0,0).



But how would I do exactly the same in 3D space?



I know the procedure to compute the angle between two vectors (v1, v2):
arccos( dot(v1, v2) / (magnitude(v1)*magnitude(v2)) )



However since I have only the input vector, I cannot use this. I would need an "origin vector" like [0,0] in 2D. Unfortunately the procedure fails when a vector is [0, 0, 0] (not surprising as it results in computing arccos of 0 / 0).



Does someone have an idea?



As additional information: I do know the normal vector of a plane where the point is found in but again I have the same problem that this normal vector does not contain an orientation,



Huge thanks in advance!







3d rotations






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 28 at 17:01









DragonGamerDragonGamer

1163




1163












  • $begingroup$
    Well, I'd recommend using either matrix rotations with Euler angles, or quaternions. Quaternions have a theoretical and practical advantage: no gymbal lock.
    $endgroup$
    – Adrian Keister
    Jan 28 at 17:04


















  • $begingroup$
    Well, I'd recommend using either matrix rotations with Euler angles, or quaternions. Quaternions have a theoretical and practical advantage: no gymbal lock.
    $endgroup$
    – Adrian Keister
    Jan 28 at 17:04
















$begingroup$
Well, I'd recommend using either matrix rotations with Euler angles, or quaternions. Quaternions have a theoretical and practical advantage: no gymbal lock.
$endgroup$
– Adrian Keister
Jan 28 at 17:04




$begingroup$
Well, I'd recommend using either matrix rotations with Euler angles, or quaternions. Quaternions have a theoretical and practical advantage: no gymbal lock.
$endgroup$
– Adrian Keister
Jan 28 at 17:04










2 Answers
2






active

oldest

votes


















0












$begingroup$

In 3D a rotation cannot be parameterized using just the rotation angle. You don't need an origin vector. The least number of parameters you need is three. For example the three Euler angles or rotation axis and rotation angle (since rotation axis is a unit vector, the rotation angle can be encoded as the length of the vector). However it is often convenient to work with four parameters such as quaternions.



Modern approach is to avoid Euler angles, so my advise is to work with axis-angle parameters (kind of 3D angle) or quaternions (not just an angle representation but a whole algebra)






share|cite|improve this answer









$endgroup$





















    0












    $begingroup$

    The struggle has come to an end. I've followed Mauricio's suggestion and found a solution based on Euler-angles.



    Am applying this algorithm to the vector I have as the "direction vector" and the normal of the mentioned plane as the "up vector": https://stackoverflow.com/questions/21622956/how-to-convert-direction-vector-to-euler-angles
    The resulting Euler angles can then be applied to any point to reproduce their rotation.
    Smooth and thanks :)






    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%2f3091125%2fabsolute-value-of-rotation-of-a-point-around-a-line-in-3d%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0












      $begingroup$

      In 3D a rotation cannot be parameterized using just the rotation angle. You don't need an origin vector. The least number of parameters you need is three. For example the three Euler angles or rotation axis and rotation angle (since rotation axis is a unit vector, the rotation angle can be encoded as the length of the vector). However it is often convenient to work with four parameters such as quaternions.



      Modern approach is to avoid Euler angles, so my advise is to work with axis-angle parameters (kind of 3D angle) or quaternions (not just an angle representation but a whole algebra)






      share|cite|improve this answer









      $endgroup$


















        0












        $begingroup$

        In 3D a rotation cannot be parameterized using just the rotation angle. You don't need an origin vector. The least number of parameters you need is three. For example the three Euler angles or rotation axis and rotation angle (since rotation axis is a unit vector, the rotation angle can be encoded as the length of the vector). However it is often convenient to work with four parameters such as quaternions.



        Modern approach is to avoid Euler angles, so my advise is to work with axis-angle parameters (kind of 3D angle) or quaternions (not just an angle representation but a whole algebra)






        share|cite|improve this answer









        $endgroup$
















          0












          0








          0





          $begingroup$

          In 3D a rotation cannot be parameterized using just the rotation angle. You don't need an origin vector. The least number of parameters you need is three. For example the three Euler angles or rotation axis and rotation angle (since rotation axis is a unit vector, the rotation angle can be encoded as the length of the vector). However it is often convenient to work with four parameters such as quaternions.



          Modern approach is to avoid Euler angles, so my advise is to work with axis-angle parameters (kind of 3D angle) or quaternions (not just an angle representation but a whole algebra)






          share|cite|improve this answer









          $endgroup$



          In 3D a rotation cannot be parameterized using just the rotation angle. You don't need an origin vector. The least number of parameters you need is three. For example the three Euler angles or rotation axis and rotation angle (since rotation axis is a unit vector, the rotation angle can be encoded as the length of the vector). However it is often convenient to work with four parameters such as quaternions.



          Modern approach is to avoid Euler angles, so my advise is to work with axis-angle parameters (kind of 3D angle) or quaternions (not just an angle representation but a whole algebra)







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 28 at 17:49









          Mauricio Cele Lopez BelonMauricio Cele Lopez Belon

          839411




          839411























              0












              $begingroup$

              The struggle has come to an end. I've followed Mauricio's suggestion and found a solution based on Euler-angles.



              Am applying this algorithm to the vector I have as the "direction vector" and the normal of the mentioned plane as the "up vector": https://stackoverflow.com/questions/21622956/how-to-convert-direction-vector-to-euler-angles
              The resulting Euler angles can then be applied to any point to reproduce their rotation.
              Smooth and thanks :)






              share|cite|improve this answer









              $endgroup$


















                0












                $begingroup$

                The struggle has come to an end. I've followed Mauricio's suggestion and found a solution based on Euler-angles.



                Am applying this algorithm to the vector I have as the "direction vector" and the normal of the mentioned plane as the "up vector": https://stackoverflow.com/questions/21622956/how-to-convert-direction-vector-to-euler-angles
                The resulting Euler angles can then be applied to any point to reproduce their rotation.
                Smooth and thanks :)






                share|cite|improve this answer









                $endgroup$
















                  0












                  0








                  0





                  $begingroup$

                  The struggle has come to an end. I've followed Mauricio's suggestion and found a solution based on Euler-angles.



                  Am applying this algorithm to the vector I have as the "direction vector" and the normal of the mentioned plane as the "up vector": https://stackoverflow.com/questions/21622956/how-to-convert-direction-vector-to-euler-angles
                  The resulting Euler angles can then be applied to any point to reproduce their rotation.
                  Smooth and thanks :)






                  share|cite|improve this answer









                  $endgroup$



                  The struggle has come to an end. I've followed Mauricio's suggestion and found a solution based on Euler-angles.



                  Am applying this algorithm to the vector I have as the "direction vector" and the normal of the mentioned plane as the "up vector": https://stackoverflow.com/questions/21622956/how-to-convert-direction-vector-to-euler-angles
                  The resulting Euler angles can then be applied to any point to reproduce their rotation.
                  Smooth and thanks :)







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Feb 4 at 11:18









                  DragonGamerDragonGamer

                  1163




                  1163






























                      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%2f3091125%2fabsolute-value-of-rotation-of-a-point-around-a-line-in-3d%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

                      in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

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