<story><title>Exponentially Better Rotations (2022)</title><url>http://thenumb.at/Exponential-Rotations/</url></story><parent_chain></parent_chain><comment><author>6gvONxR4sf7o</author><text>The lie group&amp;#x2F;lie algebra correspondence is one of the coolest things i wish i’d been taught in school. It’s the exponential and log map in the article, but in a super reusable setting.&lt;p&gt;You take some totally abstract thing you want to work with[0], say 3D rotations, but totally avoiding any details of specific coordinates that might get you into trouble. That’s the lie group.&lt;p&gt;Then you can derive representations of it in coordinates that behave nicely. This is called the corresponding lie algebra. Then for free you get a way to go back and forth between the coordinates and the abstract thing[1], and ways to compose them and stuff. Turns out that this is the exponential map and the log map talked about in the article. What’s even cooler is that you can then compose them on either side, the abstract side or the coordinate side in a way that plays nicely. You get interpolation and averaging and all that in a fairly sensible way too in most cases you’ll deal with as an engineer. And best of all, when you can phrase your problem as a combination of lie groups, you can just google for what their algebras are and get lots of work for free that would be tons of time to do yourself.&lt;p&gt;[0] the thing has to be something with a notion of smooth change, plus a bit more structure it probably has.&lt;p&gt;[1] going back and forth has some ‘connected components’ issues sometimes, but that’s just another reason it’s great to piggyback on known results.</text></comment>
<story><title>Exponentially Better Rotations (2022)</title><url>http://thenumb.at/Exponential-Rotations/</url></story><parent_chain></parent_chain><comment><author>romwell</author><text>This talks about one of my pet peeves with a lot of 3D software: they don&amp;#x27;t use Arcball[1] interface for rotation.&lt;p&gt;Autodesk products do (3DSmax, Maya), but Blender and OpenSCAD don&amp;#x27;t. And when I worked at Roblox, I couldn&amp;#x27;t convince the PM to let me implement it, because the users got by with whatever was there — and if they wanted more, they could use &lt;i&gt;something else&lt;/i&gt; (...which they did, and Roblox stock reflected that in 2022).&lt;p&gt;Arcball is based on quaternions[2] (using exp for interpolation).&lt;p&gt;It&amp;#x27;s the &lt;i&gt;only&lt;/i&gt; interface with these properties:&lt;p&gt;1. &lt;i&gt;Any&lt;/i&gt; rotation can be accomplished with a &lt;i&gt;single drag&lt;/i&gt;&lt;p&gt;2. No gimbal locks&lt;p&gt;3. Tracing a closed loop with a sequence of drags results in coming back to where you started&lt;p&gt;Once you formalize this, you can prove it mathematically (ultimately, this comes from unit quaternions giving a 2-cover of SO(3) in the same way unit complex numbers giving exactly the rotations of a circle).&lt;p&gt;For anyone interested, here is my reference implementation of Quaternions &amp;#x2F; Arcball that you can play with on the page:&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;romankogan.net&amp;#x2F;math&amp;#x2F;arcball_js&amp;#x2F;index.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;romankogan.net&amp;#x2F;math&amp;#x2F;arcball_js&amp;#x2F;index.html&lt;/a&gt;&lt;p&gt;The code is very-commented Java (Processing library, running in JavaScript by the magic of ProcessingJS).&lt;p&gt;It&amp;#x27;s one way you can &lt;i&gt;feel&lt;/i&gt; the fancy math.&lt;p&gt;Your hands and body will understand quaternions before your brain does.&lt;p&gt;If you ever work on 3D software, &lt;i&gt;please&lt;/i&gt; use this, and thanks in advance &amp;lt;3&lt;p&gt;[1] Arcball: &lt;a href=&quot;http:&amp;#x2F;&amp;#x2F;courses.cms.caltech.edu&amp;#x2F;cs171&amp;#x2F;assignments&amp;#x2F;hw3&amp;#x2F;hw3-notes&amp;#x2F;notes-hw3.html&quot; rel=&quot;nofollow&quot;&gt;http:&amp;#x2F;&amp;#x2F;courses.cms.caltech.edu&amp;#x2F;cs171&amp;#x2F;assignments&amp;#x2F;hw3&amp;#x2F;hw3-not...&lt;/a&gt;&lt;p&gt;[2] Quaternions for rotations: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Quaternions_and_spatial_rotation&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;en.wikipedia.org&amp;#x2F;wiki&amp;#x2F;Quaternions_and_spatial_rotati...&lt;/a&gt;&lt;p&gt;[3] Arcball in Processing: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;romankogan.net&amp;#x2F;math&amp;#x2F;arcball_js&amp;#x2F;index.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;romankogan.net&amp;#x2F;math&amp;#x2F;arcball_js&amp;#x2F;index.html&lt;/a&gt;</text></comment>