Quaternion that transforms a point like a 2D angle












0












$begingroup$


Am looking for a way to transpose a 2D solution of a problem to a 3D solution of the same problem.



The algorithm I've implemented in 2D works as follows:



Given the points $A (A_x, A_y)$ and $B (B_x, B_y)$.




  1. Compute the absolute angle of point $A$ via $text{atan2}(A_x, A_y) rightarrow A_alpha$

  2. Compute the absolute angle of point $B$ via $text{atan2}(B_x, B_y)rightarrow B_{alpha}$

  3. Compute the resulting point $C$ by point-distance of point $B$ and applying the angle $A_{alpha}+B_alpha$.


The effect is that $C$ is point $B$ further rotated around the origin $(0,0)$ by as much as point $A$ is rotated around origin $(0,0)$.



This image visualizes that:
2D Angles



What I need now is the same in the third dimension.
The points are threedimensional coordinates and obviously instead of angles I'll need quaternions.
Am already knowing how to apply quaternions to 3D points but I cannot get an idea how to compute the transformation quaternion that is the equivalent to $A_alpha$.



Could someone push me in the right direction perhaps?



Huge thanks in advance!










share|cite|improve this question











$endgroup$












  • $begingroup$
    How is it “obvious” that you need a quaternion? There are many ways to express rotations. Anyway, you need to nail down some more details of how you want this rotation to work: Rotations take place in a plane. Which plane do you want to use in 3D? A natural choice is the plane defined by $A$ and $B$, but then from where are you measuring the angles?
    $endgroup$
    – amd
    Dec 10 '18 at 23:48










  • $begingroup$
    @amd Thank you for the comment! Well, the engine I'm working with (Robot Operating System ROS) is using almost exclusively quaternions for transformations. Sometimes euler angles. Hmm, in 2D my reference is a horizontal line. isn't there a trivial equivalent for that in 3D? In the 3D version I need that in the case that A.z and B.z are both 0, C.x und C.y should be exactly the same as if the whole setup were still 2D.
    $endgroup$
    – DragonGamer
    Dec 11 '18 at 3:52


















0












$begingroup$


Am looking for a way to transpose a 2D solution of a problem to a 3D solution of the same problem.



The algorithm I've implemented in 2D works as follows:



Given the points $A (A_x, A_y)$ and $B (B_x, B_y)$.




  1. Compute the absolute angle of point $A$ via $text{atan2}(A_x, A_y) rightarrow A_alpha$

  2. Compute the absolute angle of point $B$ via $text{atan2}(B_x, B_y)rightarrow B_{alpha}$

  3. Compute the resulting point $C$ by point-distance of point $B$ and applying the angle $A_{alpha}+B_alpha$.


The effect is that $C$ is point $B$ further rotated around the origin $(0,0)$ by as much as point $A$ is rotated around origin $(0,0)$.



This image visualizes that:
2D Angles



What I need now is the same in the third dimension.
The points are threedimensional coordinates and obviously instead of angles I'll need quaternions.
Am already knowing how to apply quaternions to 3D points but I cannot get an idea how to compute the transformation quaternion that is the equivalent to $A_alpha$.



Could someone push me in the right direction perhaps?



Huge thanks in advance!










share|cite|improve this question











$endgroup$












  • $begingroup$
    How is it “obvious” that you need a quaternion? There are many ways to express rotations. Anyway, you need to nail down some more details of how you want this rotation to work: Rotations take place in a plane. Which plane do you want to use in 3D? A natural choice is the plane defined by $A$ and $B$, but then from where are you measuring the angles?
    $endgroup$
    – amd
    Dec 10 '18 at 23:48










  • $begingroup$
    @amd Thank you for the comment! Well, the engine I'm working with (Robot Operating System ROS) is using almost exclusively quaternions for transformations. Sometimes euler angles. Hmm, in 2D my reference is a horizontal line. isn't there a trivial equivalent for that in 3D? In the 3D version I need that in the case that A.z and B.z are both 0, C.x und C.y should be exactly the same as if the whole setup were still 2D.
    $endgroup$
    – DragonGamer
    Dec 11 '18 at 3:52
















0












0








0





$begingroup$


Am looking for a way to transpose a 2D solution of a problem to a 3D solution of the same problem.



The algorithm I've implemented in 2D works as follows:



Given the points $A (A_x, A_y)$ and $B (B_x, B_y)$.




  1. Compute the absolute angle of point $A$ via $text{atan2}(A_x, A_y) rightarrow A_alpha$

  2. Compute the absolute angle of point $B$ via $text{atan2}(B_x, B_y)rightarrow B_{alpha}$

  3. Compute the resulting point $C$ by point-distance of point $B$ and applying the angle $A_{alpha}+B_alpha$.


The effect is that $C$ is point $B$ further rotated around the origin $(0,0)$ by as much as point $A$ is rotated around origin $(0,0)$.



This image visualizes that:
2D Angles



What I need now is the same in the third dimension.
The points are threedimensional coordinates and obviously instead of angles I'll need quaternions.
Am already knowing how to apply quaternions to 3D points but I cannot get an idea how to compute the transformation quaternion that is the equivalent to $A_alpha$.



Could someone push me in the right direction perhaps?



Huge thanks in advance!










share|cite|improve this question











$endgroup$




Am looking for a way to transpose a 2D solution of a problem to a 3D solution of the same problem.



The algorithm I've implemented in 2D works as follows:



Given the points $A (A_x, A_y)$ and $B (B_x, B_y)$.




  1. Compute the absolute angle of point $A$ via $text{atan2}(A_x, A_y) rightarrow A_alpha$

  2. Compute the absolute angle of point $B$ via $text{atan2}(B_x, B_y)rightarrow B_{alpha}$

  3. Compute the resulting point $C$ by point-distance of point $B$ and applying the angle $A_{alpha}+B_alpha$.


The effect is that $C$ is point $B$ further rotated around the origin $(0,0)$ by as much as point $A$ is rotated around origin $(0,0)$.



This image visualizes that:
2D Angles



What I need now is the same in the third dimension.
The points are threedimensional coordinates and obviously instead of angles I'll need quaternions.
Am already knowing how to apply quaternions to 3D points but I cannot get an idea how to compute the transformation quaternion that is the equivalent to $A_alpha$.



Could someone push me in the right direction perhaps?



Huge thanks in advance!







transformation rotations quaternions






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 11 '18 at 15:38









Widawensen

4,69321446




4,69321446










asked Dec 10 '18 at 16:16









DragonGamerDragonGamer

1163




1163












  • $begingroup$
    How is it “obvious” that you need a quaternion? There are many ways to express rotations. Anyway, you need to nail down some more details of how you want this rotation to work: Rotations take place in a plane. Which plane do you want to use in 3D? A natural choice is the plane defined by $A$ and $B$, but then from where are you measuring the angles?
    $endgroup$
    – amd
    Dec 10 '18 at 23:48










  • $begingroup$
    @amd Thank you for the comment! Well, the engine I'm working with (Robot Operating System ROS) is using almost exclusively quaternions for transformations. Sometimes euler angles. Hmm, in 2D my reference is a horizontal line. isn't there a trivial equivalent for that in 3D? In the 3D version I need that in the case that A.z and B.z are both 0, C.x und C.y should be exactly the same as if the whole setup were still 2D.
    $endgroup$
    – DragonGamer
    Dec 11 '18 at 3:52




















  • $begingroup$
    How is it “obvious” that you need a quaternion? There are many ways to express rotations. Anyway, you need to nail down some more details of how you want this rotation to work: Rotations take place in a plane. Which plane do you want to use in 3D? A natural choice is the plane defined by $A$ and $B$, but then from where are you measuring the angles?
    $endgroup$
    – amd
    Dec 10 '18 at 23:48










  • $begingroup$
    @amd Thank you for the comment! Well, the engine I'm working with (Robot Operating System ROS) is using almost exclusively quaternions for transformations. Sometimes euler angles. Hmm, in 2D my reference is a horizontal line. isn't there a trivial equivalent for that in 3D? In the 3D version I need that in the case that A.z and B.z are both 0, C.x und C.y should be exactly the same as if the whole setup were still 2D.
    $endgroup$
    – DragonGamer
    Dec 11 '18 at 3:52


















$begingroup$
How is it “obvious” that you need a quaternion? There are many ways to express rotations. Anyway, you need to nail down some more details of how you want this rotation to work: Rotations take place in a plane. Which plane do you want to use in 3D? A natural choice is the plane defined by $A$ and $B$, but then from where are you measuring the angles?
$endgroup$
– amd
Dec 10 '18 at 23:48




$begingroup$
How is it “obvious” that you need a quaternion? There are many ways to express rotations. Anyway, you need to nail down some more details of how you want this rotation to work: Rotations take place in a plane. Which plane do you want to use in 3D? A natural choice is the plane defined by $A$ and $B$, but then from where are you measuring the angles?
$endgroup$
– amd
Dec 10 '18 at 23:48












$begingroup$
@amd Thank you for the comment! Well, the engine I'm working with (Robot Operating System ROS) is using almost exclusively quaternions for transformations. Sometimes euler angles. Hmm, in 2D my reference is a horizontal line. isn't there a trivial equivalent for that in 3D? In the 3D version I need that in the case that A.z and B.z are both 0, C.x und C.y should be exactly the same as if the whole setup were still 2D.
$endgroup$
– DragonGamer
Dec 11 '18 at 3:52






$begingroup$
@amd Thank you for the comment! Well, the engine I'm working with (Robot Operating System ROS) is using almost exclusively quaternions for transformations. Sometimes euler angles. Hmm, in 2D my reference is a horizontal line. isn't there a trivial equivalent for that in 3D? In the 3D version I need that in the case that A.z and B.z are both 0, C.x und C.y should be exactly the same as if the whole setup were still 2D.
$endgroup$
– DragonGamer
Dec 11 '18 at 3:52












0






active

oldest

votes











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%2f3034113%2fquaternion-that-transforms-a-point-like-a-2d-angle%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















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%2f3034113%2fquaternion-that-transforms-a-point-like-a-2d-angle%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

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?