求三角形标准化法向量对三个顶点的导数
我们有一个三角形有三个顶点:
x
i
x_i
xi ,
x
j
x_j
xj , 和
x
k
x_k
xk .
标准化的法向量为:
n
→
=
(
x
j
→
−
x
i
→
)
×
(
x
k
−
x
i
→
)
∣
∣
(
x
j
→
−
x
i
→
)
×
(
x
k
→
−
x
i
→
)
∣
∣
\overrightarrow{n}=\frac{(\overrightarrow{x_j}-\overrightarrow{x_i})\times(x_k-\overrightarrow{x_i})}{||(\overrightarrow{x_j}-\overrightarrow{x_i})\times(\overrightarrow{x_k}-\overrightarrow{x_i})||}
n=∣∣(xj−xi)×(xk−xi)∣∣(xj−xi)×(xk−xi)
为了求偏导, 即,
∂
n
→
∂
x
i
→
\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{x_i}}}
∂xi∂n,
∂
n
→
∂
x
j
→
\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{x_j}}}
∂xj∂n, and
∂
n
→
∂
x
k
→
\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{x_k}}}
∂xk∂n,它们均为3x3矩阵, 使用链式法则得到.
变量替换
a
→
=
x
j
→
−
x
i
→
\overrightarrow{a}=\overrightarrow{x_j}-\overrightarrow{x_i}
a=xj−xi and
b
→
=
x
k
→
−
x
i
→
\overrightarrow{b}=\overrightarrow{x_k}-\overrightarrow{x_i}
b=xk−xi, 使用链式法则后:
∂
n
→
∂
x
i
,
j
,
k
→
=
∂
n
→
∂
a
→
∂
a
→
∂
x
i
,
j
,
k
→
+
∂
n
→
∂
b
→
∂
b
→
∂
x
i
,
j
,
k
→
\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{x_{i,j,k}}}}=\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{a}}}\frac{\partial{\overrightarrow{a}}}{\partial{\overrightarrow{x_{i,j,k}}}}+\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{b}}}\frac{\partial{\overrightarrow{b}}}{\partial{\overrightarrow{x_{i,j,k}}}}
∂xi,j,k∂n=∂a∂n∂xi,j,k∂a+∂b∂n∂xi,j,k∂b
这些偏导可以很容易求得:
{
∂
a
→
∂
x
i
→
=
−
I
3
×
3
∂
a
→
∂
x
j
→
=
I
3
×
3
∂
a
→
∂
x
k
→
=
0
3
×
3
\begin{cases} \frac{\partial{\overrightarrow{a}}}{\partial{\overrightarrow{x_{i}}}}=-\textbf{I}_{3\times3} \\ \frac{\partial{\overrightarrow{a}}}{\partial{\overrightarrow{x_{j}}}}=\textbf{I}_{3\times3} \\ \frac{\partial{\overrightarrow{a}}}{\partial{\overrightarrow{x_{k}}}}=\textbf{0}_{3\times3} \end{cases}
⎩
⎨
⎧∂xi∂a=−I3×3∂xj∂a=I3×3∂xk∂a=03×3
{
∂
b
→
∂
x
i
→
=
−
I
3
×
3
∂
b
→
∂
x
j
→
=
0
3
×
3
∂
b
→
∂
x
k
→
=
I
3
×
3
\begin{cases} \frac{\partial{\overrightarrow{b}}}{\partial{\overrightarrow{x_{i}}}}=-\textbf{I}_{3\times3} \\ \frac{\partial{\overrightarrow{b}}}{\partial{\overrightarrow{x_{j}}}}=\textbf{0}_{3\times3} \\ \frac{\partial{\overrightarrow{b}}}{\partial{\overrightarrow{x_{k}}}}=\textbf{I}_{3\times3} \end{cases}
⎩
⎨
⎧∂xi∂b=−I3×3∂xj∂b=03×3∂xk∂b=I3×3
现在我们只需要求
∂
n
→
∂
a
→
\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{a}}}
∂a∂n 和
∂
n
→
∂
b
→
\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{b}}}
∂b∂n:
引理
\textbf{引理}
引理:
∂
(
a
→
×
b
→
)
∂
a
→
=
−
[
B
]
,
∂
(
a
→
×
b
→
)
∂
b
→
=
[
A
]
,
∂
∣
∣
n
→
∣
∣
∂
n
→
=
n
→
∣
∣
n
→
∣
∣
\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}=-[B],\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{b}}}=[A],\frac{\partial{||\overrightarrow{n}||}}{\partial{\overrightarrow{n}}}=\frac{{\overrightarrow{n}}}{{||\overrightarrow{n}||}}
∂a∂(a×b)=−[B],∂b∂(a×b)=[A],∂n∂∣∣n∣∣=∣∣n∣∣n
其中
[
A
]
[A]
[A] 和
[
B
]
[B]
[B] 是向量
a
→
\overrightarrow{a}
a 和
b
→
\overrightarrow{b}
b的反对称矩阵(skew matrix)
因此:
∂
n
→
∂
a
→
=
∂
∂
a
→
(
a
→
×
b
→
∣
∣
a
→
×
b
→
∣
∣
)
=
∂
(
a
→
×
b
→
)
∂
a
→
∣
∣
a
→
×
b
→
∣
∣
−
(
a
→
×
b
→
)
⊗
∂
∣
∣
a
→
×
b
→
∣
∣
∂
a
→
∣
∣
a
→
×
b
→
∣
∣
2
=
∂
(
a
→
×
b
→
)
∂
a
→
∣
∣
a
→
×
b
→
∣
∣
−
(
a
→
×
b
→
)
⊗
(
a
→
×
b
→
)
∣
∣
a
→
×
b
→
∣
∣
∂
(
a
→
×
b
→
)
∂
a
→
∣
∣
a
→
×
b
→
∣
∣
2
=
∂
(
a
→
×
b
→
)
∂
a
→
−
(
a
→
×
b
→
)
∣
∣
a
→
×
b
→
∣
∣
⊗
(
a
→
×
b
→
)
∣
∣
a
→
×
b
→
∣
∣
∂
(
a
→
×
b
→
)
∂
a
→
∣
∣
a
→
×
b
→
∣
∣
=
∂
(
a
→
×
b
→
)
∂
a
→
−
n
→
⊗
n
→
∂
(
a
→
×
b
→
)
∂
a
→
∣
∣
a
→
×
b
→
∣
∣
=
I
3
×
3
−
n
→
⊗
n
→
∣
∣
a
→
×
b
→
∣
∣
∂
(
a
→
×
b
→
)
∂
a
→
\begin{aligned} \frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{a}}} &=\frac{\partial{}}{\partial{\overrightarrow{a}}}(\frac{\overrightarrow{a}\times\overrightarrow{b}}{||\overrightarrow{a}\times\overrightarrow{b}||}) \\ &=\frac{\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}||\overrightarrow{a}\times\overrightarrow{b}||-(\overrightarrow{a}\times\overrightarrow{b})\otimes\frac{\partial{||\overrightarrow{a}\times\overrightarrow{b}||}}{\partial{\overrightarrow{a}}}}{||\overrightarrow{a}\times\overrightarrow{b}||^2} \\ &= \frac{\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}||\overrightarrow{a}\times\overrightarrow{b}||-(\overrightarrow{a}\times\overrightarrow{b})\otimes\frac{(\overrightarrow{a}\times\overrightarrow{b})}{||\overrightarrow{a}\times\overrightarrow{b}||}\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}}{||\overrightarrow{a}\times\overrightarrow{b}||^2} \\ &=\frac{\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}-\frac{(\overrightarrow{a}\times\overrightarrow{b})}{||\overrightarrow{a}\times\overrightarrow{b}||}\otimes\frac{(\overrightarrow{a}\times\overrightarrow{b})}{||\overrightarrow{a}\times\overrightarrow{b}||}\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}}{||\overrightarrow{a}\times\overrightarrow{b}||} \\ &=\frac{\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}-{\overrightarrow{n}}\otimes{\overrightarrow{n}}\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}}}{||\overrightarrow{a}\times\overrightarrow{b}||} \\ &= \frac{\textbf{I}_{3\times3}-{\overrightarrow{n}}\otimes{\overrightarrow{n}}}{||\overrightarrow{a}\times\overrightarrow{b}||}\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{a}}} \end{aligned}
∂a∂n=∂a∂(∣∣a×b∣∣a×b)=∣∣a×b∣∣2∂a∂(a×b)∣∣a×b∣∣−(a×b)⊗∂a∂∣∣a×b∣∣=∣∣a×b∣∣2∂a∂(a×b)∣∣a×b∣∣−(a×b)⊗∣∣a×b∣∣(a×b)∂a∂(a×b)=∣∣a×b∣∣∂a∂(a×b)−∣∣a×b∣∣(a×b)⊗∣∣a×b∣∣(a×b)∂a∂(a×b)=∣∣a×b∣∣∂a∂(a×b)−n⊗n∂a∂(a×b)=∣∣a×b∣∣I3×3−n⊗n∂a∂(a×b)
同样的:
∂
n
→
∂
b
→
=
I
3
×
3
−
n
→
⊗
n
→
∣
∣
a
→
×
b
→
∣
∣
∂
(
a
→
×
b
→
)
∂
b
→
\begin{aligned} \frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{b}}} &= \frac{\textbf{I}_{3\times3}-{\overrightarrow{n}}\otimes{\overrightarrow{n}}}{||\overrightarrow{a}\times\overrightarrow{b}||}\frac{\partial{(\overrightarrow{a}\times\overrightarrow{b})}}{\partial{\overrightarrow{b}}} \end{aligned}
∂b∂n=∣∣a×b∣∣I3×3−n⊗n∂b∂(a×b)
替换
T
=
I
3
×
3
−
n
→
⊗
n
→
∣
∣
a
→
×
b
→
∣
∣
T=\frac{\textbf{I}_{3\times3}-{\overrightarrow{n}}\otimes{\overrightarrow{n}}}{||\overrightarrow{a}\times\overrightarrow{b}||}
T=∣∣a×b∣∣I3×3−n⊗n
∂
n
→
∂
a
→
=
−
T
[
B
]
,
∂
n
→
∂
b
→
=
T
[
A
]
\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{a}}}=-T[B],\frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{b}}}=T[A]
∂a∂n=−T[B],∂b∂n=T[A]
带入上面的链式法则,我们最终得到:
{
∂
n
→
∂
x
i
→
=
T
(
[
B
]
−
[
A
]
)
∂
n
→
∂
x
j
→
=
−
T
[
B
]
∂
n
→
∂
x
k
→
=
T
[
A
]
\begin{cases} \frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{x_{i}}}}=T([B]-[A]) \\ \frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{x_{j}}}}=-T[B] \\ \frac{\partial{\overrightarrow{n}}}{\partial{\overrightarrow{x_{k}}}}=T[A] \end{cases}
⎩
⎨
⎧∂xi∂n=T([B]−[A])∂xj∂n=−T[B]∂xk∂n=T[A]
参考:
1)https://math.stackexchange.com/questions/2614305/derivative-of-cross-product-of-vectors-with-respect-to-vector
2)https://math.stackexchange.com/questions/1985897/can-matrices-do-cross-product-with-vectors