已经知道三角形三点A(X1,Y1) B(X2,Y2) C(X3,Y3)
\[
\vec{AB} = (X2-X1,Y2-Y1)
\]
\[
\vec{AC} = (X3-X1,Y3-Y1)
\]
\[
||n|| = \vec{AB} \times \vec{AC} = |\vec{AB}|\cdot|\vec{AB}|*Sin<\vec{AB},\vec{AC}>
\]
\[
因为 |\vec{AB}|*Sin<\vec{AB},\vec{AC}> 为三角形的高
\]
\[
所以 S_{三角形}= \frac{1}{2} | \vec{AB} \times \vec{AC}|
\]
\[=
\begin{vmatrix}
X2-X1 & Y2-Y1\ X3-X1 & Y3-Y1
\end{vmatrix}
\]
\[
= (X2-X1)(Y3-Y1) * (X3-X1)(Y2-Y1)
\]
\[
= X1Y2 + X2Y3 + X3Y1 - X1Y3 - X2Y1 - X3Y2
\]
原文地址:https://www.cnblogs.com/--zz/p/11209429.html
时间: 2024-11-05 18:48:08