<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/11137" />

	<title>Real-Time Physics Simulation Forum</title>
	
	<link href="https://pybullet.org/Bullet/phpBB3/index.php" />
	<updated>2016-09-10T21:13:26+00:00</updated>

	<author><name><![CDATA[Real-Time Physics Simulation Forum]]></name></author>
	<id>https://pybullet.org/Bullet/phpBB3/app.php/feed/topic/11137</id>

		<entry>
		<author><name><![CDATA[JoeLubertazzi]]></name></author>
		<updated>2016-09-10T21:13:26+00:00</updated>

		<published>2016-09-10T21:13:26+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38179#p38179</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38179#p38179"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38179#p38179"><![CDATA[
Hey, gilbo!<br><br>First of all, thank you for the wonderful explanation; it was very clear and and gave me enough detail to expand the derivation about a different coordinate frame. If you have the opportunity, please let me know if my derivation is correct:<br><br>Given p' = Rp + r, where p is the original particle position, R is the rotation into the new coordinate frame, r is the translation into the new coordinate frame, and p' is the particle's position in the new coordinate frame, we can use the original derivation of kinetic energy with p' in place of p:<br><br>Integrate_p[ 0.5 * m(p) * &lt;V(p'),V(p')&gt; ]<br><br>= 0.5*S_p[ m(p) * [ &lt;v,v&gt; + 2 *&lt;v,(w x p')&gt; + &lt;(w x p'),(w x p')&gt; ] ]<br>= 0.5*S_p[ m(p) * [ &lt;v,v&gt; + 2 *&lt;v,(w x (Rp + r))&gt; + &lt;(w x (Rp + r)),(w x (Rp + r))&gt; ] ]<br>= 0.5*S_p[ m(p) * [ &lt;v,v&gt; + 2 *&lt;v,((w x Rp) + (w x r))&gt; + &lt;((w x Rp) + (w x r)),((w x Rp) + (w x r))&gt; ] ]<br>= 0.5*S_p[ m(p) * [ &lt;v,v&gt; + 2 *&lt;v, (w x Rp)&gt; + 2 * &lt;v, (w x r)&gt; + &lt;(w x Rp), (w x Rp)&gt; + &lt;(w x r), (w x r)&gt; + 2 * &lt;(w x Rp), (w x r)&gt; ] ]<br><br>Now using the scalar-triple product &lt;a, (b x c)&gt; = &lt;b, (c x a)&gt; = &lt;c, (a x b)&gt;, the definition of &lt;(w x p),(w x p)&gt; = w’P’Pw, and let Q be the anti-symmetric matrix of r:<br><br>= 0.5 * S_p[ m(p) * &lt;v, v&gt; + 2 * m(p) * &lt;Rp, (v x w)&gt; * + 2 * m(p) * &lt;r, (v x w)&gt; + m(p) * w'R'P'PRw + m(p) * w'Q'Qw + 2 * m(p) * &lt;(w x Rp), (w x r)&gt; ]<br>= 0.5 * S_p[ m(p) * &lt;v, v&gt; + 2 * m(p) * &lt;(v x w), (r + Rp)&gt; + m(p) * w'( R'P'PR +Q'Q )w + 2 * m(p) * &lt;(w x Rp), (w x r)&gt; ]<br>= 0.5 * M * &lt;v, v&gt; + M*&lt;(v x w), (r + R*CoM)&gt; + 0.5 * w'(R'IR + MQ'Q)w + &lt;(w x (w x r)), R*CoM&gt;<br><br>Here, the first term is the linear kinetic energy. The second term makes use of the center of mass in the new coordinate frame. The third term makes use of the inertia tensor in the new coordinate frame. I'm not entirely sure what the fourth term is (possibly related to gyroscopic motion?).<br><br>The R'IR makes sense, as this is how we transform the inertia tensor at CoM from body-space to world-space. The MQ'Q is the second term of Steiner's theorem (as described <a href="https://en.wikipedia.org/wiki/Parallel_axis_theorem" class="postlink">here</a>). The r + R*CoM also makes sense, as this how how we transform the CoM from body-space to world-space.<br><br>Once again, if you can offer some feedback on my derivation that'd be greatly appreciated (I probably messed up some algebra along the way, too).<br><br>Thanks!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11703">JoeLubertazzi</a> — Sat Sep 10, 2016 9:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[gilbo]]></name></author>
		<updated>2016-09-09T10:25:42+00:00</updated>

		<published>2016-09-09T10:25:42+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38176#p38176</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38176#p38176"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=38176#p38176"><![CDATA[
Hi Joe,<br><br>I can't comment on the code much, but as for the math, there are some simple principles from which you can derive nearly all of rotational/rigid-body mechanics, including the inertia tensor.  (Apologies if these are obvious.)<br><br>principle 1)  You can think of linear and angular velocity as jointly defining a vector field over 3d-space, which is the velocity at each point in space. (although of course only meaningful for points actually on the rigid body.)  Specifically, let v be the linear velocity and w the angular velocity.  Then the velocity of a point V(p) = v + (w x p).  (x being the cross product)<br><br>1.1) The set of all velocity fields of the above form is closed under changes of origin/basis.  proof sketch: Let Rp + r be a change of basis formula, where R is an orthonormal matrix.  Then V(p) = (v + (w x r)) + (w x Rp).  (w x y) = Wy, where W is an anti-symmetric matrix.  The product WR of an anti-symmetric and orthonormal matrix is anti-symmetric, which means we can transform it back into a cross product.  We usually choose to express angular velocity at the center of mass because it's convenient for many formulas, and for reasoning about the values, but we could express all our velocities in world coordinates...<br><br>principle 2)  You can (more or less) derive all rotational mechanics by just looking at particle mechanics, the above notion of a velocity field, and cranking through the mathematical consequences.  Many particular quantities fall out from this process.<br><br>2.1) Define the kinetic energy of a rigid body as the integration over the kinetic energy of all of its constituent particles.  i.e. Integrate_p[ 0.5 * m(p) * &lt;V(p),V(p&gt; ]  (where &lt;x,y&gt; denotes dot product of vectors).  Now, consider the following algebraic manipulations:<br><br>(Let S_p be an abbreviation of Integrate_p)<br>(Let W be the anti symmetric matrix corresponding to the cross product (w x ...))<br>(Let P be the anti symmetric matrix corresponding to the cross product (p x ...))<br>(Let A’ x’ denote transposes of matrices and vectors)<br><br>= 0.5*S_p[ m(p) * &lt;v,v&gt; + 2*&lt;v,(w x p)&gt; + &lt;(w x p),(w x p)&gt; ]<br>= 0.5*S_p[ m(p)*&lt;v,v&gt; ]  +  S_p[ m(p)*&lt;v,(w x p)&gt; ]  +  0.5*S_p[ m(p) * (see below) ]<br>= 0.5*S_p[ m(p) ]*&lt;v,v&gt;  +  &lt;v, (w x S_p[ m(p) p ])&gt;  +  0.5*S_p[ m(p) * w’P’Pw ]<br>= 0.5* M *&lt;v,v&gt;  +  &lt;v, (w x CoM)&gt;  +  0.5*w’ I w<br><br>for above: &lt;(w x p),(w x p)&gt; = &lt;(p x w),(p x w)&gt; = w’P’Pw<br><br>That is, we now have an expression, where none of the integrals depend any longer on the velocity field.  So, we can pre-compute these three values<br><br>M = S_p[ m(p) ] is the total mass of the body.<br>CoM = S_p[ m(p) * p ] is the center-of-mass of the body<br>I = S_p[ m(p) * P’P ] is the “inertia tensor”<br><br>Note that the first of the three terms in the summation is the linear kinetic energy.  If we use a coordinate frame centered at the center of mass, then the second term will always be zero.  Finally, the last term is the angular kinetic energy, in which the inertia tensor plays the role of mass.<br><br>If we compose these two principles together, we can derive a formula for the inertia tensor expressed in a different coordinate frame.  Forgive me for skipping that part.  You can derive Steiner's theorem as a special case of such an exercise.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11353">gilbo</a> — Fri Sep 09, 2016 10:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[RandyGaul]]></name></author>
		<updated>2016-05-12T20:19:17+00:00</updated>

		<published>2016-05-12T20:19:17+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37549#p37549</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37549#p37549"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37549#p37549"><![CDATA[
Oh I see what you meant. I thought the old post was shifting to COM with a subtraction (I didn't read carefully).<br><br>I = I_cm + md^2, d^2 -&gt; always positive, aka the distance from origin matters, and any vector (positive or negative) fixed on the origin will be the same result.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10235">RandyGaul</a> — Thu May 12, 2016 8:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2016-05-12T20:08:14+00:00</updated>

		<published>2016-05-12T20:08:14+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37548#p37548</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37548#p37548"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37548#p37548"><![CDATA[
There is no bug. The sign of the translation doesn't matter (I leave this an exercise to prove). I agree that it is confusing though. What is important is that you add when you move <strong class="text-strong">away </strong>from the center of mass and subtract when you move <strong class="text-strong">into </strong>the center of mass.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Thu May 12, 2016 8:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[RandyGaul]]></name></author>
		<updated>2016-05-12T18:00:48+00:00</updated>

		<published>2016-05-12T18:00:48+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37547#p37547</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37547#p37547"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37547#p37547"><![CDATA[
A 7 year old bug! <img class="smilies" src="https://pybullet.org/Bullet/phpBB3/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=10235">RandyGaul</a> — Thu May 12, 2016 6:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JoeLubertazzi]]></name></author>
		<updated>2016-05-12T16:41:54+00:00</updated>

		<published>2016-05-12T16:41:54+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37546#p37546</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37546#p37546"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37546#p37546"><![CDATA[
If I recall the T.mTranslation was originally negative and the mass.center was always negative, although I could be mistaken. In any case, thanks for all the help!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11703">JoeLubertazzi</a> — Thu May 12, 2016 4:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2016-05-12T16:24:44+00:00</updated>

		<published>2016-05-12T16:24:44+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37545#p37545</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37545#p37545"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37545#p37545"><![CDATA[
I think I fixed the negative center of mass in your cited post. This is what I was referring to in my earlier post.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Thu May 12, 2016 4:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JoeLubertazzi]]></name></author>
		<updated>2016-05-12T18:59:58+00:00</updated>

		<published>2016-05-12T14:54:58+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37544#p37544</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37544#p37544"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37544#p37544"><![CDATA[
I stumbled across a more mathematical explanation <a href="http://www.gamedev.net/page/resources/_/technical/math-and-physics/capsule-inertia-tensor-r3856" class="postlink">here</a>, specifically equations 10 and 11.<br><br>Steiner's theorem states that:<br><br>I' = I_cm + mr^2<br><br>In Dirk's derivation while accumulating individual shape mass, we have I_cm and need to shift it by mr^2 to get I'. After we have accumulated all inertia, we have I' and need to find I_cm:<br><br>I_cm = I' - mr^2<br><br>I still don't know why Dirk uses the negative center of mass for the final shift, but I'm fairly sure this would result in the same Steiner term if using positive center of mass (just by looking at the algebra).<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11703">JoeLubertazzi</a> — Thu May 12, 2016 2:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[JoeLubertazzi]]></name></author>
		<updated>2016-05-04T17:48:13+00:00</updated>

		<published>2016-05-04T17:48:13+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37443#p37443</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37443#p37443"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37443#p37443"><![CDATA[
Thanks for the elaboration, Dirk!<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=11703">JoeLubertazzi</a> — Wed May 04, 2016 5:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dirk Gregorius]]></name></author>
		<updated>2016-05-04T18:13:08+00:00</updated>

		<published>2016-05-04T16:49:18+00:00</published>
		<id>https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37442#p37442</id>
		<link href="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37442#p37442"/>
		<title type="html"><![CDATA[Re: Steiner's Theorem for Composite Bodies]]></title>

		
		<content type="html" xml:base="https://pybullet.org/Bullet/phpBB3/viewtopic.php?p=37442#p37442"><![CDATA[
Regarding the addition/subtraction you were asking about:<br>- The inertia tensor is 'smallest' at the center of mass. So if you shift away from the center of mass you add (grow) and if you move into the center of mass you subtract (reduce).<br><br>Edit: Looking at the quoted post there was a sign error I just fixed.<p>Statistics: Posted by <a href="https://pybullet.org/Bullet/phpBB3/memberlist.php?mode=viewprofile&amp;u=14">Dirk Gregorius</a> — Wed May 04, 2016 4:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
