Content deleted Content added
m Maintain {{WPBS}} and vital articles: 1 WikiProject template. Create {{WPBS}}. Keep majority rating "C" in {{WPBS}}. Remove 1 same rating as {{WPBS}} in {{Maths rating}}. Remove 1 deprecated parameter: field. Tag: |
|||
(11 intermediate revisions by 5 users not shown) | |||
Line 1:
{{Talk header |hide_find_sources=yes}}
{{WikiProject banner shell |class=C |collapsed=yes |
{{WikiProject Mathematics|priority=mid}}
}}
{{User:MiszaBot/config
|archiveheader = {{talk archive navigation}}
|maxarchivesize = 80K
|counter = 2
|minthreadsleft = 5
|minthreadstoarchive = 2
|algo = old(730d)
|archive = Talk:Quaternions and spatial rotation/Archive %(counter)d
}}
== Compared to rotation matrices ==
Line 955 ⟶ 25:
:Applying and composing rotations aren't the only operations to consider either. Quaternions are easier to interpolate (again, useful for tangent space calculations on a GPU for example, but also for animation, modeling, etc...).
:"more numerically stable" -- this is un-doubtfuly true. When repeatedly composing rotations (eg in rigid body simulations) rotation matrices will inevitably become non-orthogonal. There are different ways to re-orthogonalize them, trading off precision and performance. In contrast to those, quaternions don't suffer from that issue at all. [[User:Ybungalobill|bungalo]] ([[User talk:Ybungalobill|talk]]) 20:09, 19 May 2020 (UTC)
::"compact, efficient, and numerically stable" better are sourced or reasoned indeed IMO.
::The rotation matrix in the tooltip of the linked words "rotation matrices" in the sentence of above quote alone for example requires only Theta, making it more compact than a quaternion. Here reasoning is missing.
::"efficient" in what respect: efficiency is a kind of output per input; are quaternions less time consuming to use for a high research effort? This would make them inefficient. So the respect is missing.
::"numerically stable": comparing rotation matrices sin and cos range 0...1 being multiplied with each other multiple times with unit quaternions being multiplied with each other multiple times, I don't get an idea of a significant different numerical stableness. Non-othogonal is a semantic issue, stableness is rather a syntactic issue. [[Special:Contributions/2A02:2455:30C:7D00:3931:FDDB:9442:9713|2A02:2455:30C:7D00:3931:FDDB:9442:9713]] ([[User talk:2A02:2455:30C:7D00:3931:FDDB:9442:9713|talk]]) 23:55, 29 August 2025 (UTC)
== Labelling the formulas in the Alternative Convention section ==
Line 973 ⟶ 47:
<math display="block">\vec{\rm z} = \tfrac{1}{\sin \left( \frac{\theta}{2} \right) }\,\vec{v}</math>
<!-- Template:Unsigned --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Jalexiou|Jalexiou]] ([[User talk:Jalexiou#top|talk]] • [[Special:Contributions/Jalexiou|contribs]]) 16:26, 11 June 2022 (UTC)</small>
== rotations and matrices ==
Line 979 ⟶ 55:
Shouldn't that be the other way around? That is, one rotation has two representations – not that one matrix can represent two rotations. —[[User:Tamfang|Tamfang]] ([[User talk:Tamfang|talk]]) 05:41, 2 August 2023 (UTC)
== xyzw order? ==
I believe when written as four numbers, it is relatively common to write them with the cosine term last, ie it is a 3-vector containing the axis multiplied by sin/2, followed by cos/2. This lines up the vector with 3-space vectors written in homogenous coordinates, making it very popular in code that already has to deal with those. Anybody know if there is any real convention to do it this way, and/or the way shown in the article with the cos term first? [[User:Spitzak|Spitzak]] ([[User talk:Spitzak|talk]]) 17:55, 8 October 2024 (UTC)
:In many contexts, quaternions are written as the sum of four parts in a specific order: the real part, the i part, the j part, and the k part. That form carries over to having the cosine be first, and is the one that I am most familiar with. If you've seen it the other way ... then there are (at least) two ways to do it. If this is a vote, I vote for having the {{math|cos}} term first. —[[User:Quantling|<span class="texhtml"><i>Q</i></span>uantling]] ([[User talk:Quantling|talk]] | [[Special:Contributions/Quantling|contribs]]) 18:19, 8 October 2024 (UTC)
::Not suggesting it be changed, just wondering if it should be noted in case somebody is looking at code that works that way. Looking at some existing code such as Pixar's math library, it looks like they are pretty careful to make the api return the real and vector parts as two different pieces, and indexing only works on the vector (ie you write quat.vector[2] to get the z, not quat[3] or quat[2]). I think though there are some tiny advantages on GPUs to storing the quaternions as xyzw so this is often done. [[User:Spitzak|Spitzak]] ([[User talk:Spitzak|talk]]) 23:56, 8 October 2024 (UTC)
:::Looking at Pixar's `GfQuatd` it does appear to lay out the memory as I said, but they definitely hide this in the api. There is a 4-number constructor but it has the real part first, then the imaginary vector. In the private part of the data structure they store 4 doubles and they put the real part last, this may have been done so the memory can be sent to the GPU. Some other libraries I looked at seem to store the real part first. [[User:Spitzak|Spitzak]] ([[User talk:Spitzak|talk]]) 00:08, 9 October 2024 (UTC)
== Reasoning for #Performance_comparisons missing, unspecific ==
[22] and [23] are currently present. [22] is unspecific: is it a replier in some forum thread? [23] needs a qualifier such as "as in code published at ...".<br>
<br>
Method in table 1 under Storage requirements is linked to articles but does not specify the look further which makes "Rotation matrix" at least ambigious (2D? 3D? 4D?) and the numbers in the storage column are not referenced in the paragraph below the table which is why they are not reasoned.<br>
<br>
"Performance comparison of rotation chaining operations" does not include angle-axis after angle-axis which is 2 x angle-axis of "Performance comparison of vector rotating operations".<br>
<br>
"Performance comparison of vector rotating operations" does not explain intermediate matrix, does not consider transforming vector to quaternion first which requires C and S of Theta/2 which is 2 sin/cos and 1 mul/div.<br>
<br>
"Rotation matrix" is likely a rotation around a 3D base vector as axis which is not equal an arbitrary angle-axis or a quaternion and thus should be marked with an asterisk.<br>
<br>
Performance comparisons can consider time ___domain when parallel computing if this whole section is original work: a dot product would be 1 op instead of 3 mul and 2 add for example. [[Special:Contributions/2A02:2455:30C:7D00:3931:FDDB:9442:9713|2A02:2455:30C:7D00:3931:FDDB:9442:9713]] ([[User talk:2A02:2455:30C:7D00:3931:FDDB:9442:9713|talk]]) 23:41, 29 August 2025 (UTC)
|