Content deleted Content added
Ebernardes (talk | contribs) |
|||
(11 intermediate revisions by 7 users not shown) | |||
Line 1:
{{WikiProject banner shell|class=Start|
{{WikiProject Mathematics|priority=low}}
}}
{{Old merge full|otherpage=Charts on SO(3)|date=August 30, 2011|result=No Consensus|talk=Talk:Charts on SO(3)#Conversion between quaternions and Euler angles}}
Line 22 ⟶ 24:
==Which definition of the Euler angles is being employed in this page?==
Absolutely no mention is given as to which (of the 12 possible) definitions of the Euler angles are being employed in this discussion.
I agree. This seems to be using the Tait-Brain (or whatever spelling) convention.
This one here is the standard: https://hepweb.ucsd.edu/ph110b/110b_notes/node36.html . It uses the sequence z-y-z, with notation phi, theta, psi.
We can easily verify that the formulas given on this page are wrong for that standard, by computing omega once from phi,theta,psi and their derivatives, and once from the quaternion q as per the presented formula her, and its derivative dq.
This article is frustrating because it pretends a hands-on appeal ("just pick up the equations and use them for your project") when in fact they are plainly incorrect. I only noticed it when GPT pointed me to where it came up with those inconclusive equations; so you are doing a lot of damage here. I propose we pull this article offline until it is correct and verified to be correct. And since we can verify correctness of algebra, I would suggest we go ahead and do this for all Wikipedia articles that feature any formulas. <!-- Template:Unsigned IP --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/31.17.92.45|31.17.92.45]] ([[User talk:31.17.92.45#top|talk]]) 11:21, 29 October 2024 (UTC)</small> <!--Autosigned by SineBot-->
:Totally agree, this page does not make much sense.
:I personally think this page should be scrapped, condensed to a little section called "conversion between ZYX Tait-Bryan angles and quaternions" that only gives out the equations, explains why this sequence is being given particular interest (because it's the most used) and then add it to the main page called [[Quaternions and spatial rotation]].
:This would be MUCH less confusing, in my opinion, and still gives the formula in a "just pick up the equations and use them for your project" way, albeit more explicitly. [[User:Ebernardes|Ebernardes]] ([[User talk:Ebernardes|talk]]) 11:44, 29 October 2024 (UTC)
== Order of angles specified? ==
Line 123 ⟶ 137:
And I think in your code above, <code>pitch1</code> is the new code, and <code>pitch2</code> was the old calculation, right? What are the problems with <code>pitch2</code>? Why is using <code>pitch1</code> better? Also, you have a typo I believe: it should be <code>pitch2 = np.arcsin(2*(w*y - z*x))</code>. You have <code>w*x</code> mistakenly where <code>w*y</code> goes.
--[[User:ERCaGuy|ERCaGuy]] ([[User talk:ERCaGuy|talk]]) 03:55, 12 October 2023 (UTC)
:Hey there @[[User:ERCaGuy|ERCaGuy]], thank you for your interest! Indeed, there is a typo! But since I did the same typo twice it still passed the test: the important where was to numerically show that, for our values, <math>\arcsin(2 \sigma) = 2 \arctan2(1 + 2 \sigma, 1 - 2\sigma) - \pi/2</math> for some value of <math>\sigma</math>.
:As to why this is arguably better, there was an explanation but it was removed in this edit: https://en.wikipedia.org/w/index.php?title=Conversion_between_quaternions_and_Euler_angles&oldid=1128353649.
:Basically, <math>\arcsin, \arccos</math> are not as numerically well-behaved as <math>\arctan2</math>, which is why we used this version when I updated the transformation code in https://scipy.org/. This is, in my opinion, still not the best version, as this needs the quaternion to be normalized beforehand and the (because of the summation with 1, etc).
:If you're interested, I showed how to get these equations on this open access paper: https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0276302. Moreover, apart from Scipy, I also implemented it on Sympy, which can be useful if you want to play with the equations symbolically. [[User:Ebernardes|Ebernardes]] ([[User talk:Ebernardes|talk]]) 06:51, 12 October 2023 (UTC)
::Just a heads-up though: the first definitions on this paper have sadly a mistake, and I still didn't manage to make the editors correct it... [[User:Ebernardes|Ebernardes]] ([[User talk:Ebernardes|talk]]) 06:51, 12 October 2023 (UTC)
:: @[[User:Ebernardes|Ebernardes]], thank you for all of the responses and links! This is helpful. For anyone wishing to have some Python code to use and test, here is my [https://github.com/ElectricRCAircraftGuy/eRCaGuy_hello_world/blob/master/python/quaternions_to_euler_angles.py quaternions_to_euler_angles.py] Python program from my [https://github.com/ElectricRCAircraftGuy/eRCaGuy_hello_world eRCaGuy_hello_world] repo. I test both techniques. See functions <code>quaternion2euler()</code> and <code>quaternion2euler2()</code>. I run unit tests on them both too. <!-- Template:Unsigned --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:ERCaGuy|ERCaGuy]] ([[User talk:ERCaGuy#top|talk]] • [[Special:Contributions/ERCaGuy|contribs]]) 16:24, 19 October 2023 (UTC)</small> <!--Autosigned by SineBot-->
:::@[[User:ERCaGuy|ERCaGuy]] I'm glad I could help! If you're interested, you can find my implementation of the general method [https://github.com/evbernardes/quaternion_to_euler in my repo].
:::Moreover, in the SciPy implementation there are also two implemented conversion methods: an older one from matrix to angles, and the one I published from quaternions directly to angles. The former is not used anymore, except for the unit tests: we wanted to make absolutely sure that the new conversions gave the same answers. [[User:Ebernardes|Ebernardes]] ([[User talk:Ebernardes|talk]]) 07:40, 20 October 2023 (UTC)
== Cleanup ==
This article reads like a stream of consciousness university lecture, rather than a Wikipedia article. I personally find the inclusion of sample code to be particularly out of place, but the POV of the article is really strange as well. I recommend that it be cleaned up. [[User:TimeEngineer|TimeEngineer]] ([[User talk:TimeEngineer|talk]]) 13:52, 28 January 2024 (UTC)
:I totally agree that this is a strange page. I do not really have the time to attempt rewriting it, but I'm up for helping with the math if a rewrite is ever done. [[User:Ebernardes|Ebernardes]] ([[User talk:Ebernardes|talk]]) 13:35, 29 August 2024 (UTC)
|