Derivative norm vector repect to time 《PBM by Pixar》 Appendix D.2 code


Vector Calculus

1 Derivative normal vector repect to time

Let's denote the unit normal vector as:

\[\mathbf{n} =\frac{\mathbf{e}_a\times\mathbf{e}_b}{\|\mathbf{e}_a\times\mathbf{e}_b\|} = \frac{1}{\|\mathbf{e}_a\times\mathbf{e}_b\|} \cdot \mathbf{e}_a\times\mathbf{e}_b \]

Where \(\times\) denotesthecrossproduct,and \(\parallel \cdot \parallel\) denotes the norm.

Now, let's find the time derivative \(\frac{d\mathbf{n}}{dt}\).

We'll use the product rule, chain rule, and quotient rule as necessary.

\[\frac{d\mathbf{n}}{dt} = \frac{1}{\|\mathbf{e}_a \times \mathbf{e}_b\|} \cdot \frac{d}{dt}(\mathbf{e}_a \times \mathbf{e}_b) - \frac{(\mathbf{n} \cdot (\mathbf{e}_a \times \mathbf{e}_b)) \cdot \frac{d}{dt}(\mathbf{e}_a \times \mathbf{e}_b)}{\|\mathbf{e}_a \times \mathbf{e}_b\|^2} \]

1.1 Derivative vector norm repect to time

Let's denote \(\mathbf{v}=\mathbf{e}_a\times\mathbf{e}_b\). The norm of v is given by \(\|\mathbf{v}\|=\sqrt{\mathbf{v}\cdot\mathbf{v}}.\)

Now, let's find the derivative of the norm with respect to time \(t\)

\[\frac d{dt}\|\mathbf{v}\|=\frac1{2\sqrt{\mathbf{v}\cdot\mathbf{v}}}\cdot\frac d{dt}(\mathbf{v}\cdot\mathbf{v}) \]

Applying the chain rule and the product rule:

\[\frac d{dt}\|\mathbf{v}\|=\frac1{2\|\mathbf{v}\|}\cdot\frac d{dt}(\mathbf{v}\cdot\mathbf{v}) \]

Now, expand the dot product \(\mathbf{v}\cdot\mathbf{v}:\)

\[\frac{d}{dt}\|\mathbf{v}\|=\frac{1}{2\|\mathbf{v}\|}\cdot\frac{d}{dt}(\mathbf{e}_a\times\mathbf{e}_b\cdot\mathbf{e}_a\times\mathbf{e}_b) \]

Apply the product rule and the chain rule:

\[\frac{d}{dt}\|\mathbf{v}\|=\frac{1}{2\|\mathbf{v}\|}\cdot\left(2(\mathbf{e}_a\times\mathbf{e}_b)\cdot\frac{d}{dt}(\mathbf{e}_a\times\mathbf{e}_b)\right) \]

X Ref

  1. 《Rigid Body Dynamics Lecture Notes》by David Baraff
  2. ChatGPT 3.5
posted @ 2023-12-20 13:58  Dba_sys  阅读(7)  评论(0编辑  收藏  举报