$A$

$B$

$C$

$Step=%v$

$P$

$Q$

1.\;作任意三角形\Delta ABC

$2.\;以\overline{AB}為一邊，\;做一正方形ABPQ，\;包含\Delta ABC  .$

$3.\;\Delta ACQ=\frac{1}{2}bcsin(90°-A)=\frac{1}{2}bccosA$
$\;\;\;\;\Delta PBC=\frac{1}{2}acsin(90°-B)=\frac{1}{2}accosB$

4.\;\Delta ACQ+\Delta PBC=\frac{c^2}{2}

$5.\;同理：\;accos\beta+abcos\gamma =a^2,abcos\gamma+bccos\alpha=b²$

$7.\;三式相加得：\;$
$2bccos\alpha+2accos\beta+2abcosγ=a^2+b^2+c²...♣$

6.\; \left\lbrace \begin{array}{} bccosA+accosB=c² ...♠\accosB+abcosC=a^2...♡ \ abcosC+bccosA=b^2...♢ \end{array}  \right.\

8.\left\lbrace\begin{array}{ll} ♣-2×♠:2abcosC=a+b-c² \ ♣-2×♡:2bccosA=b+c-a² \ ♣-2×♠:2accosB=a²+c-b² \end{array}   \right.\

餘弦定理：\;\left\lbrace \begin{array}{ll} a²=b²+c²-2bccosA \ b²=a²+c²-2cacosB \ c²=a²+b²-2abcosC \end{array}  \right.\

$4.\;\Delta PBC-\Delta ACQ=\frac{c²}{2}$
$=acsin(90-B)-bcsin(A-90°)=accosB+bccosA$

A = (7.34, -0.78)
B = (12.22, -0.8)
C = (10.18, 0.7)
s = 0 (slider from 0 to 9, step 1)
a = Segment(C, B)
b = Segment(C, A)
c = Segment(A, B)
poly1, d, e, f, g, P, Q = Polygon(A, B, 4)
h = Segment(Q, C)
i = Segment(C, P)
j = Line(C, c)
D, E = Intersect(j, poly1)
k = Segment(D, E)
poly2, a_1, c_1, q = Polygon(C, Q, A)
poly3, b_1, p, c_2 = Polygon(P, C, B)
α = Angle(B, A, C)
l = Segment(C, E)