3D rotation orientation












5












$begingroup$


My problem involves finding a formula for this:



You're given a line that passes through the origin in 3D space (more specifically, a point on the line). You are then given a point and an angle. The task is to find where the point ends up after a counterclockwise rotation around the line by the angle.



I managed to do this by reformulating the problem as an intersection of three spheres, but I got two results: one clockwise and one counterclockwise.



At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.



Is there a way to choose from the two destination points such that rotating objects (such as a cube, given its vertices) aren't deformed (because the points rotate in different directions)?










share|cite|improve this question









$endgroup$












  • $begingroup$
    I think the orientation is implicitly determined by the direction from the origin to the point that defines the line. // Also, see Rodrigues' rotation formula.
    $endgroup$
    – Rahul
    Jan 15 at 11:30












  • $begingroup$
    The direction of rotation is commonly, but not always, described from the point of view of looking back from the point on the line toward the origin. To be sure, though, you should compare this to other problems and examples from wherever you got this problem or ask your instructor/TA to clarify. Which direction does this source mean by a counterclockwise rotation about the $x$-axis, say? Choose a direction for this one that’s consistent with that terminology.
    $endgroup$
    – amd
    Jan 15 at 20:51












  • $begingroup$
    I have no instructor. I'm trying to learn math and programming by making a simple 3D engine. This is a problem related to camera rotation.
    $endgroup$
    – Kotlopou
    Jan 16 at 8:07
















5












$begingroup$


My problem involves finding a formula for this:



You're given a line that passes through the origin in 3D space (more specifically, a point on the line). You are then given a point and an angle. The task is to find where the point ends up after a counterclockwise rotation around the line by the angle.



I managed to do this by reformulating the problem as an intersection of three spheres, but I got two results: one clockwise and one counterclockwise.



At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.



Is there a way to choose from the two destination points such that rotating objects (such as a cube, given its vertices) aren't deformed (because the points rotate in different directions)?










share|cite|improve this question









$endgroup$












  • $begingroup$
    I think the orientation is implicitly determined by the direction from the origin to the point that defines the line. // Also, see Rodrigues' rotation formula.
    $endgroup$
    – Rahul
    Jan 15 at 11:30












  • $begingroup$
    The direction of rotation is commonly, but not always, described from the point of view of looking back from the point on the line toward the origin. To be sure, though, you should compare this to other problems and examples from wherever you got this problem or ask your instructor/TA to clarify. Which direction does this source mean by a counterclockwise rotation about the $x$-axis, say? Choose a direction for this one that’s consistent with that terminology.
    $endgroup$
    – amd
    Jan 15 at 20:51












  • $begingroup$
    I have no instructor. I'm trying to learn math and programming by making a simple 3D engine. This is a problem related to camera rotation.
    $endgroup$
    – Kotlopou
    Jan 16 at 8:07














5












5








5





$begingroup$


My problem involves finding a formula for this:



You're given a line that passes through the origin in 3D space (more specifically, a point on the line). You are then given a point and an angle. The task is to find where the point ends up after a counterclockwise rotation around the line by the angle.



I managed to do this by reformulating the problem as an intersection of three spheres, but I got two results: one clockwise and one counterclockwise.



At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.



Is there a way to choose from the two destination points such that rotating objects (such as a cube, given its vertices) aren't deformed (because the points rotate in different directions)?










share|cite|improve this question









$endgroup$




My problem involves finding a formula for this:



You're given a line that passes through the origin in 3D space (more specifically, a point on the line). You are then given a point and an angle. The task is to find where the point ends up after a counterclockwise rotation around the line by the angle.



I managed to do this by reformulating the problem as an intersection of three spheres, but I got two results: one clockwise and one counterclockwise.



At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.



Is there a way to choose from the two destination points such that rotating objects (such as a cube, given its vertices) aren't deformed (because the points rotate in different directions)?







analytic-geometry 3d rotations






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Jan 15 at 11:07









KotlopouKotlopou

462




462












  • $begingroup$
    I think the orientation is implicitly determined by the direction from the origin to the point that defines the line. // Also, see Rodrigues' rotation formula.
    $endgroup$
    – Rahul
    Jan 15 at 11:30












  • $begingroup$
    The direction of rotation is commonly, but not always, described from the point of view of looking back from the point on the line toward the origin. To be sure, though, you should compare this to other problems and examples from wherever you got this problem or ask your instructor/TA to clarify. Which direction does this source mean by a counterclockwise rotation about the $x$-axis, say? Choose a direction for this one that’s consistent with that terminology.
    $endgroup$
    – amd
    Jan 15 at 20:51












  • $begingroup$
    I have no instructor. I'm trying to learn math and programming by making a simple 3D engine. This is a problem related to camera rotation.
    $endgroup$
    – Kotlopou
    Jan 16 at 8:07


















  • $begingroup$
    I think the orientation is implicitly determined by the direction from the origin to the point that defines the line. // Also, see Rodrigues' rotation formula.
    $endgroup$
    – Rahul
    Jan 15 at 11:30












  • $begingroup$
    The direction of rotation is commonly, but not always, described from the point of view of looking back from the point on the line toward the origin. To be sure, though, you should compare this to other problems and examples from wherever you got this problem or ask your instructor/TA to clarify. Which direction does this source mean by a counterclockwise rotation about the $x$-axis, say? Choose a direction for this one that’s consistent with that terminology.
    $endgroup$
    – amd
    Jan 15 at 20:51












  • $begingroup$
    I have no instructor. I'm trying to learn math and programming by making a simple 3D engine. This is a problem related to camera rotation.
    $endgroup$
    – Kotlopou
    Jan 16 at 8:07
















$begingroup$
I think the orientation is implicitly determined by the direction from the origin to the point that defines the line. // Also, see Rodrigues' rotation formula.
$endgroup$
– Rahul
Jan 15 at 11:30






$begingroup$
I think the orientation is implicitly determined by the direction from the origin to the point that defines the line. // Also, see Rodrigues' rotation formula.
$endgroup$
– Rahul
Jan 15 at 11:30














$begingroup$
The direction of rotation is commonly, but not always, described from the point of view of looking back from the point on the line toward the origin. To be sure, though, you should compare this to other problems and examples from wherever you got this problem or ask your instructor/TA to clarify. Which direction does this source mean by a counterclockwise rotation about the $x$-axis, say? Choose a direction for this one that’s consistent with that terminology.
$endgroup$
– amd
Jan 15 at 20:51






$begingroup$
The direction of rotation is commonly, but not always, described from the point of view of looking back from the point on the line toward the origin. To be sure, though, you should compare this to other problems and examples from wherever you got this problem or ask your instructor/TA to clarify. Which direction does this source mean by a counterclockwise rotation about the $x$-axis, say? Choose a direction for this one that’s consistent with that terminology.
$endgroup$
– amd
Jan 15 at 20:51














$begingroup$
I have no instructor. I'm trying to learn math and programming by making a simple 3D engine. This is a problem related to camera rotation.
$endgroup$
– Kotlopou
Jan 16 at 8:07




$begingroup$
I have no instructor. I'm trying to learn math and programming by making a simple 3D engine. This is a problem related to camera rotation.
$endgroup$
– Kotlopou
Jan 16 at 8:07










4 Answers
4






active

oldest

votes


















2












$begingroup$

Let's say the line passes through origin $(0,0,0)$ and point $vec{ell} =(x_ell , y_ell, z_ell)$, the point to be rotated is $(x, y, z)$.



The line represents our rotation axis. Calculate the unit rotation axis $hat{a} = ( x_a , y_a , z_a )$:
$$bbox{ hat{a} = frac{vec{ell}}{leftlVertvec{ell}rightrVert} = left( frac{x_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{y_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{z_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} right ) }$$



To rotate point $vec{p}$ by angle $theta$ around unit axis vector $hat{a}$, we can use Rodrigues' rotation formula:
$$bbox[#ffffef, 1em]{ vec{p}^prime = vec{p} costheta + (hat{a} times vec{p}) sintheta + hat{a} ( hat{a} cdot vec{p} ) (1 - cos theta) }$$
where $vec{p}^prime$ is the location of the point after the rotation.



If the $hat{a}(hat{a}cdotvec{p})(1 - costheta)$ throws you off, note that the first term, $hat{a}$, is a vector, but both the second and third terms are reals.



In case you have forgotten, for $vec{a} = ( x_a , y_a , z_a )$ and $vec{b} = ( x_b , y_b , z_b )$, and $c$ a real,
$$begin{array}{l|l}
; & c vec{a} = ( c x_a , c y_a , c z_a ) \
hline
; & vec{a} + vec{b} = ( x_a + x_b , y_a + y_b , z_a + z_b ) \
hline
text{Dot product} & vec{a} cdot vec{b} = x_a x_b + y_a y_b + z_a z_b \
hline
text{Cross product} & vec{a} times vec{b} = ( y_a z_b - z_a y_b , z_a x_b - x_a z_b , x_a y_b - y_a x_b ) \
hline
text{Euclidean length or $ell^2$-norm} & leftlVert vec{a} rightrVert = sqrt{ vec{a} cdot vec{a} } = sqrt{ x_a^2 + y_a^2 + z_a^2 } \
end{array}$$






share|cite|improve this answer









$endgroup$





















    0












    $begingroup$

    Let $p$ be the first point lying on the line passing through the origin. Since the line passes through the origin $0$ also lies on it. We can form the unit vector $frac{p-0}{||p-0||_2} = hat{p}$, this will be our rotation axis. Let the point we want to rotate around the axis be $v$. After that find the axis-angle rotation matrix $M(hat{p},theta)$ (https://en.wikipedia.org/wiki/Rotation_matrix#Axis_and_angle) and the rotate point is $v' = Mv$.






    share|cite|improve this answer









    $endgroup$













    • $begingroup$
      Is this invertible (given the point and its destination, find the oriented angle)?
      $endgroup$
      – Kotlopou
      Jan 15 at 11:48










    • $begingroup$
      Rotation matrices are invertible $R^{-1} = R^T$. The only issues you may have, is if $p=0$ then $0,p$ does not define a line anymore, and you cannot get the axis.
      $endgroup$
      – lightxbulb
      Jan 15 at 11:50





















    0












    $begingroup$


    Is there a way to choose from the two destination points such that
    rotating objects (such as a cube, given its vertices) aren't deformed
    (because the points rotate in different directions)?




    The answer depends; does the choice of "destination points" have to be continuous on the space of lines and angles? Or does it have to be continuous for each line?



    In the latter case, the answer is trivially yes: just pick an orientation. But in the first case I think the answer is no, because a continuous choice of orientation on the space of lines $mathbb{P^2(R)}$ amounts to a global section of the covering map $pi: S^2tomathbb{P^2(R)}$, which happens not to exist.



    There is also the fact that $mathbb{P^2(R)}$ is non-orientable, but being a beginner in differential geometry/topology, I'm not sure if the issue can be characterized in terms of that.






    share|cite|improve this answer









    $endgroup$





















      0












      $begingroup$

      You hit the nail on the head!




      At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.




      Unless the problem is specified further, there is not really a solution. You could always try to find it experimentally, by simply choosing a scheme to derive the direction for each line (rotational axis).



      Some possible schemes are:




      1. Assume that each line is oriented towards the origin.

      2. Assume that each line is oriented away from the origin.

      3. Assume that each line is oriented towards positive $x$. (If orthogonal to the $x$-axis, try $y$, then $z$.)


      (Since you said that you have lines represented by a point, I am assuming that you will never encounter a point at the origin, since this doesn't specify a line.)



      Regardless of the choice made, objects rotated around a particular line won't be deformed, because the same assumption is used in rotating each vertex. This solves the problem, except for that mention of "counterclockwise".



      Now, if all of those options work for you, great! But most likely you will find that only one of options 1 and 2 lead to a satisfactory result. Besides having a solution, you will then also know the missing information in the original problem - the meaning of "counterclockwise" in this context.






      share|cite|improve this answer









      $endgroup$














        Your Answer








        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%2f3074324%2f3d-rotation-orientation%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        2












        $begingroup$

        Let's say the line passes through origin $(0,0,0)$ and point $vec{ell} =(x_ell , y_ell, z_ell)$, the point to be rotated is $(x, y, z)$.



        The line represents our rotation axis. Calculate the unit rotation axis $hat{a} = ( x_a , y_a , z_a )$:
        $$bbox{ hat{a} = frac{vec{ell}}{leftlVertvec{ell}rightrVert} = left( frac{x_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{y_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{z_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} right ) }$$



        To rotate point $vec{p}$ by angle $theta$ around unit axis vector $hat{a}$, we can use Rodrigues' rotation formula:
        $$bbox[#ffffef, 1em]{ vec{p}^prime = vec{p} costheta + (hat{a} times vec{p}) sintheta + hat{a} ( hat{a} cdot vec{p} ) (1 - cos theta) }$$
        where $vec{p}^prime$ is the location of the point after the rotation.



        If the $hat{a}(hat{a}cdotvec{p})(1 - costheta)$ throws you off, note that the first term, $hat{a}$, is a vector, but both the second and third terms are reals.



        In case you have forgotten, for $vec{a} = ( x_a , y_a , z_a )$ and $vec{b} = ( x_b , y_b , z_b )$, and $c$ a real,
        $$begin{array}{l|l}
        ; & c vec{a} = ( c x_a , c y_a , c z_a ) \
        hline
        ; & vec{a} + vec{b} = ( x_a + x_b , y_a + y_b , z_a + z_b ) \
        hline
        text{Dot product} & vec{a} cdot vec{b} = x_a x_b + y_a y_b + z_a z_b \
        hline
        text{Cross product} & vec{a} times vec{b} = ( y_a z_b - z_a y_b , z_a x_b - x_a z_b , x_a y_b - y_a x_b ) \
        hline
        text{Euclidean length or $ell^2$-norm} & leftlVert vec{a} rightrVert = sqrt{ vec{a} cdot vec{a} } = sqrt{ x_a^2 + y_a^2 + z_a^2 } \
        end{array}$$






        share|cite|improve this answer









        $endgroup$


















          2












          $begingroup$

          Let's say the line passes through origin $(0,0,0)$ and point $vec{ell} =(x_ell , y_ell, z_ell)$, the point to be rotated is $(x, y, z)$.



          The line represents our rotation axis. Calculate the unit rotation axis $hat{a} = ( x_a , y_a , z_a )$:
          $$bbox{ hat{a} = frac{vec{ell}}{leftlVertvec{ell}rightrVert} = left( frac{x_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{y_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{z_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} right ) }$$



          To rotate point $vec{p}$ by angle $theta$ around unit axis vector $hat{a}$, we can use Rodrigues' rotation formula:
          $$bbox[#ffffef, 1em]{ vec{p}^prime = vec{p} costheta + (hat{a} times vec{p}) sintheta + hat{a} ( hat{a} cdot vec{p} ) (1 - cos theta) }$$
          where $vec{p}^prime$ is the location of the point after the rotation.



          If the $hat{a}(hat{a}cdotvec{p})(1 - costheta)$ throws you off, note that the first term, $hat{a}$, is a vector, but both the second and third terms are reals.



          In case you have forgotten, for $vec{a} = ( x_a , y_a , z_a )$ and $vec{b} = ( x_b , y_b , z_b )$, and $c$ a real,
          $$begin{array}{l|l}
          ; & c vec{a} = ( c x_a , c y_a , c z_a ) \
          hline
          ; & vec{a} + vec{b} = ( x_a + x_b , y_a + y_b , z_a + z_b ) \
          hline
          text{Dot product} & vec{a} cdot vec{b} = x_a x_b + y_a y_b + z_a z_b \
          hline
          text{Cross product} & vec{a} times vec{b} = ( y_a z_b - z_a y_b , z_a x_b - x_a z_b , x_a y_b - y_a x_b ) \
          hline
          text{Euclidean length or $ell^2$-norm} & leftlVert vec{a} rightrVert = sqrt{ vec{a} cdot vec{a} } = sqrt{ x_a^2 + y_a^2 + z_a^2 } \
          end{array}$$






          share|cite|improve this answer









          $endgroup$
















            2












            2








            2





            $begingroup$

            Let's say the line passes through origin $(0,0,0)$ and point $vec{ell} =(x_ell , y_ell, z_ell)$, the point to be rotated is $(x, y, z)$.



            The line represents our rotation axis. Calculate the unit rotation axis $hat{a} = ( x_a , y_a , z_a )$:
            $$bbox{ hat{a} = frac{vec{ell}}{leftlVertvec{ell}rightrVert} = left( frac{x_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{y_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{z_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} right ) }$$



            To rotate point $vec{p}$ by angle $theta$ around unit axis vector $hat{a}$, we can use Rodrigues' rotation formula:
            $$bbox[#ffffef, 1em]{ vec{p}^prime = vec{p} costheta + (hat{a} times vec{p}) sintheta + hat{a} ( hat{a} cdot vec{p} ) (1 - cos theta) }$$
            where $vec{p}^prime$ is the location of the point after the rotation.



            If the $hat{a}(hat{a}cdotvec{p})(1 - costheta)$ throws you off, note that the first term, $hat{a}$, is a vector, but both the second and third terms are reals.



            In case you have forgotten, for $vec{a} = ( x_a , y_a , z_a )$ and $vec{b} = ( x_b , y_b , z_b )$, and $c$ a real,
            $$begin{array}{l|l}
            ; & c vec{a} = ( c x_a , c y_a , c z_a ) \
            hline
            ; & vec{a} + vec{b} = ( x_a + x_b , y_a + y_b , z_a + z_b ) \
            hline
            text{Dot product} & vec{a} cdot vec{b} = x_a x_b + y_a y_b + z_a z_b \
            hline
            text{Cross product} & vec{a} times vec{b} = ( y_a z_b - z_a y_b , z_a x_b - x_a z_b , x_a y_b - y_a x_b ) \
            hline
            text{Euclidean length or $ell^2$-norm} & leftlVert vec{a} rightrVert = sqrt{ vec{a} cdot vec{a} } = sqrt{ x_a^2 + y_a^2 + z_a^2 } \
            end{array}$$






            share|cite|improve this answer









            $endgroup$



            Let's say the line passes through origin $(0,0,0)$ and point $vec{ell} =(x_ell , y_ell, z_ell)$, the point to be rotated is $(x, y, z)$.



            The line represents our rotation axis. Calculate the unit rotation axis $hat{a} = ( x_a , y_a , z_a )$:
            $$bbox{ hat{a} = frac{vec{ell}}{leftlVertvec{ell}rightrVert} = left( frac{x_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{y_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} , frac{z_ell}{sqrt{x_ell^2 + y_ell^2 + z_ell^2}} right ) }$$



            To rotate point $vec{p}$ by angle $theta$ around unit axis vector $hat{a}$, we can use Rodrigues' rotation formula:
            $$bbox[#ffffef, 1em]{ vec{p}^prime = vec{p} costheta + (hat{a} times vec{p}) sintheta + hat{a} ( hat{a} cdot vec{p} ) (1 - cos theta) }$$
            where $vec{p}^prime$ is the location of the point after the rotation.



            If the $hat{a}(hat{a}cdotvec{p})(1 - costheta)$ throws you off, note that the first term, $hat{a}$, is a vector, but both the second and third terms are reals.



            In case you have forgotten, for $vec{a} = ( x_a , y_a , z_a )$ and $vec{b} = ( x_b , y_b , z_b )$, and $c$ a real,
            $$begin{array}{l|l}
            ; & c vec{a} = ( c x_a , c y_a , c z_a ) \
            hline
            ; & vec{a} + vec{b} = ( x_a + x_b , y_a + y_b , z_a + z_b ) \
            hline
            text{Dot product} & vec{a} cdot vec{b} = x_a x_b + y_a y_b + z_a z_b \
            hline
            text{Cross product} & vec{a} times vec{b} = ( y_a z_b - z_a y_b , z_a x_b - x_a z_b , x_a y_b - y_a x_b ) \
            hline
            text{Euclidean length or $ell^2$-norm} & leftlVert vec{a} rightrVert = sqrt{ vec{a} cdot vec{a} } = sqrt{ x_a^2 + y_a^2 + z_a^2 } \
            end{array}$$







            share|cite|improve this answer












            share|cite|improve this answer



            share|cite|improve this answer










            answered Jan 16 at 7:15









            Nominal AnimalNominal Animal

            7,1882617




            7,1882617























                0












                $begingroup$

                Let $p$ be the first point lying on the line passing through the origin. Since the line passes through the origin $0$ also lies on it. We can form the unit vector $frac{p-0}{||p-0||_2} = hat{p}$, this will be our rotation axis. Let the point we want to rotate around the axis be $v$. After that find the axis-angle rotation matrix $M(hat{p},theta)$ (https://en.wikipedia.org/wiki/Rotation_matrix#Axis_and_angle) and the rotate point is $v' = Mv$.






                share|cite|improve this answer









                $endgroup$













                • $begingroup$
                  Is this invertible (given the point and its destination, find the oriented angle)?
                  $endgroup$
                  – Kotlopou
                  Jan 15 at 11:48










                • $begingroup$
                  Rotation matrices are invertible $R^{-1} = R^T$. The only issues you may have, is if $p=0$ then $0,p$ does not define a line anymore, and you cannot get the axis.
                  $endgroup$
                  – lightxbulb
                  Jan 15 at 11:50


















                0












                $begingroup$

                Let $p$ be the first point lying on the line passing through the origin. Since the line passes through the origin $0$ also lies on it. We can form the unit vector $frac{p-0}{||p-0||_2} = hat{p}$, this will be our rotation axis. Let the point we want to rotate around the axis be $v$. After that find the axis-angle rotation matrix $M(hat{p},theta)$ (https://en.wikipedia.org/wiki/Rotation_matrix#Axis_and_angle) and the rotate point is $v' = Mv$.






                share|cite|improve this answer









                $endgroup$













                • $begingroup$
                  Is this invertible (given the point and its destination, find the oriented angle)?
                  $endgroup$
                  – Kotlopou
                  Jan 15 at 11:48










                • $begingroup$
                  Rotation matrices are invertible $R^{-1} = R^T$. The only issues you may have, is if $p=0$ then $0,p$ does not define a line anymore, and you cannot get the axis.
                  $endgroup$
                  – lightxbulb
                  Jan 15 at 11:50
















                0












                0








                0





                $begingroup$

                Let $p$ be the first point lying on the line passing through the origin. Since the line passes through the origin $0$ also lies on it. We can form the unit vector $frac{p-0}{||p-0||_2} = hat{p}$, this will be our rotation axis. Let the point we want to rotate around the axis be $v$. After that find the axis-angle rotation matrix $M(hat{p},theta)$ (https://en.wikipedia.org/wiki/Rotation_matrix#Axis_and_angle) and the rotate point is $v' = Mv$.






                share|cite|improve this answer









                $endgroup$



                Let $p$ be the first point lying on the line passing through the origin. Since the line passes through the origin $0$ also lies on it. We can form the unit vector $frac{p-0}{||p-0||_2} = hat{p}$, this will be our rotation axis. Let the point we want to rotate around the axis be $v$. After that find the axis-angle rotation matrix $M(hat{p},theta)$ (https://en.wikipedia.org/wiki/Rotation_matrix#Axis_and_angle) and the rotate point is $v' = Mv$.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Jan 15 at 11:34









                lightxbulblightxbulb

                1,169311




                1,169311












                • $begingroup$
                  Is this invertible (given the point and its destination, find the oriented angle)?
                  $endgroup$
                  – Kotlopou
                  Jan 15 at 11:48










                • $begingroup$
                  Rotation matrices are invertible $R^{-1} = R^T$. The only issues you may have, is if $p=0$ then $0,p$ does not define a line anymore, and you cannot get the axis.
                  $endgroup$
                  – lightxbulb
                  Jan 15 at 11:50




















                • $begingroup$
                  Is this invertible (given the point and its destination, find the oriented angle)?
                  $endgroup$
                  – Kotlopou
                  Jan 15 at 11:48










                • $begingroup$
                  Rotation matrices are invertible $R^{-1} = R^T$. The only issues you may have, is if $p=0$ then $0,p$ does not define a line anymore, and you cannot get the axis.
                  $endgroup$
                  – lightxbulb
                  Jan 15 at 11:50


















                $begingroup$
                Is this invertible (given the point and its destination, find the oriented angle)?
                $endgroup$
                – Kotlopou
                Jan 15 at 11:48




                $begingroup$
                Is this invertible (given the point and its destination, find the oriented angle)?
                $endgroup$
                – Kotlopou
                Jan 15 at 11:48












                $begingroup$
                Rotation matrices are invertible $R^{-1} = R^T$. The only issues you may have, is if $p=0$ then $0,p$ does not define a line anymore, and you cannot get the axis.
                $endgroup$
                – lightxbulb
                Jan 15 at 11:50






                $begingroup$
                Rotation matrices are invertible $R^{-1} = R^T$. The only issues you may have, is if $p=0$ then $0,p$ does not define a line anymore, and you cannot get the axis.
                $endgroup$
                – lightxbulb
                Jan 15 at 11:50













                0












                $begingroup$


                Is there a way to choose from the two destination points such that
                rotating objects (such as a cube, given its vertices) aren't deformed
                (because the points rotate in different directions)?




                The answer depends; does the choice of "destination points" have to be continuous on the space of lines and angles? Or does it have to be continuous for each line?



                In the latter case, the answer is trivially yes: just pick an orientation. But in the first case I think the answer is no, because a continuous choice of orientation on the space of lines $mathbb{P^2(R)}$ amounts to a global section of the covering map $pi: S^2tomathbb{P^2(R)}$, which happens not to exist.



                There is also the fact that $mathbb{P^2(R)}$ is non-orientable, but being a beginner in differential geometry/topology, I'm not sure if the issue can be characterized in terms of that.






                share|cite|improve this answer









                $endgroup$


















                  0












                  $begingroup$


                  Is there a way to choose from the two destination points such that
                  rotating objects (such as a cube, given its vertices) aren't deformed
                  (because the points rotate in different directions)?




                  The answer depends; does the choice of "destination points" have to be continuous on the space of lines and angles? Or does it have to be continuous for each line?



                  In the latter case, the answer is trivially yes: just pick an orientation. But in the first case I think the answer is no, because a continuous choice of orientation on the space of lines $mathbb{P^2(R)}$ amounts to a global section of the covering map $pi: S^2tomathbb{P^2(R)}$, which happens not to exist.



                  There is also the fact that $mathbb{P^2(R)}$ is non-orientable, but being a beginner in differential geometry/topology, I'm not sure if the issue can be characterized in terms of that.






                  share|cite|improve this answer









                  $endgroup$
















                    0












                    0








                    0





                    $begingroup$


                    Is there a way to choose from the two destination points such that
                    rotating objects (such as a cube, given its vertices) aren't deformed
                    (because the points rotate in different directions)?




                    The answer depends; does the choice of "destination points" have to be continuous on the space of lines and angles? Or does it have to be continuous for each line?



                    In the latter case, the answer is trivially yes: just pick an orientation. But in the first case I think the answer is no, because a continuous choice of orientation on the space of lines $mathbb{P^2(R)}$ amounts to a global section of the covering map $pi: S^2tomathbb{P^2(R)}$, which happens not to exist.



                    There is also the fact that $mathbb{P^2(R)}$ is non-orientable, but being a beginner in differential geometry/topology, I'm not sure if the issue can be characterized in terms of that.






                    share|cite|improve this answer









                    $endgroup$




                    Is there a way to choose from the two destination points such that
                    rotating objects (such as a cube, given its vertices) aren't deformed
                    (because the points rotate in different directions)?




                    The answer depends; does the choice of "destination points" have to be continuous on the space of lines and angles? Or does it have to be continuous for each line?



                    In the latter case, the answer is trivially yes: just pick an orientation. But in the first case I think the answer is no, because a continuous choice of orientation on the space of lines $mathbb{P^2(R)}$ amounts to a global section of the covering map $pi: S^2tomathbb{P^2(R)}$, which happens not to exist.



                    There is also the fact that $mathbb{P^2(R)}$ is non-orientable, but being a beginner in differential geometry/topology, I'm not sure if the issue can be characterized in terms of that.







                    share|cite|improve this answer












                    share|cite|improve this answer



                    share|cite|improve this answer










                    answered Jan 16 at 8:55









                    Matthew CramerusMatthew Cramerus

                    272




                    272























                        0












                        $begingroup$

                        You hit the nail on the head!




                        At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.




                        Unless the problem is specified further, there is not really a solution. You could always try to find it experimentally, by simply choosing a scheme to derive the direction for each line (rotational axis).



                        Some possible schemes are:




                        1. Assume that each line is oriented towards the origin.

                        2. Assume that each line is oriented away from the origin.

                        3. Assume that each line is oriented towards positive $x$. (If orthogonal to the $x$-axis, try $y$, then $z$.)


                        (Since you said that you have lines represented by a point, I am assuming that you will never encounter a point at the origin, since this doesn't specify a line.)



                        Regardless of the choice made, objects rotated around a particular line won't be deformed, because the same assumption is used in rotating each vertex. This solves the problem, except for that mention of "counterclockwise".



                        Now, if all of those options work for you, great! But most likely you will find that only one of options 1 and 2 lead to a satisfactory result. Besides having a solution, you will then also know the missing information in the original problem - the meaning of "counterclockwise" in this context.






                        share|cite|improve this answer









                        $endgroup$


















                          0












                          $begingroup$

                          You hit the nail on the head!




                          At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.




                          Unless the problem is specified further, there is not really a solution. You could always try to find it experimentally, by simply choosing a scheme to derive the direction for each line (rotational axis).



                          Some possible schemes are:




                          1. Assume that each line is oriented towards the origin.

                          2. Assume that each line is oriented away from the origin.

                          3. Assume that each line is oriented towards positive $x$. (If orthogonal to the $x$-axis, try $y$, then $z$.)


                          (Since you said that you have lines represented by a point, I am assuming that you will never encounter a point at the origin, since this doesn't specify a line.)



                          Regardless of the choice made, objects rotated around a particular line won't be deformed, because the same assumption is used in rotating each vertex. This solves the problem, except for that mention of "counterclockwise".



                          Now, if all of those options work for you, great! But most likely you will find that only one of options 1 and 2 lead to a satisfactory result. Besides having a solution, you will then also know the missing information in the original problem - the meaning of "counterclockwise" in this context.






                          share|cite|improve this answer









                          $endgroup$
















                            0












                            0








                            0





                            $begingroup$

                            You hit the nail on the head!




                            At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.




                            Unless the problem is specified further, there is not really a solution. You could always try to find it experimentally, by simply choosing a scheme to derive the direction for each line (rotational axis).



                            Some possible schemes are:




                            1. Assume that each line is oriented towards the origin.

                            2. Assume that each line is oriented away from the origin.

                            3. Assume that each line is oriented towards positive $x$. (If orthogonal to the $x$-axis, try $y$, then $z$.)


                            (Since you said that you have lines represented by a point, I am assuming that you will never encounter a point at the origin, since this doesn't specify a line.)



                            Regardless of the choice made, objects rotated around a particular line won't be deformed, because the same assumption is used in rotating each vertex. This solves the problem, except for that mention of "counterclockwise".



                            Now, if all of those options work for you, great! But most likely you will find that only one of options 1 and 2 lead to a satisfactory result. Besides having a solution, you will then also know the missing information in the original problem - the meaning of "counterclockwise" in this context.






                            share|cite|improve this answer









                            $endgroup$



                            You hit the nail on the head!




                            At this point I have no idea how to figure out which is which, because "counterclockwise" isn't a sufficient definition. You must know which way the line is oriented.




                            Unless the problem is specified further, there is not really a solution. You could always try to find it experimentally, by simply choosing a scheme to derive the direction for each line (rotational axis).



                            Some possible schemes are:




                            1. Assume that each line is oriented towards the origin.

                            2. Assume that each line is oriented away from the origin.

                            3. Assume that each line is oriented towards positive $x$. (If orthogonal to the $x$-axis, try $y$, then $z$.)


                            (Since you said that you have lines represented by a point, I am assuming that you will never encounter a point at the origin, since this doesn't specify a line.)



                            Regardless of the choice made, objects rotated around a particular line won't be deformed, because the same assumption is used in rotating each vertex. This solves the problem, except for that mention of "counterclockwise".



                            Now, if all of those options work for you, great! But most likely you will find that only one of options 1 and 2 lead to a satisfactory result. Besides having a solution, you will then also know the missing information in the original problem - the meaning of "counterclockwise" in this context.







                            share|cite|improve this answer












                            share|cite|improve this answer



                            share|cite|improve this answer










                            answered Jan 16 at 14:11









                            SegoroSegoro

                            1




                            1






























                                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%2f3074324%2f3d-rotation-orientation%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

                                Bressuire

                                Cabo Verde

                                Gyllenstierna