mathematica 发表于 2021-3-2 08:28:05

求三角形ABC的面积

求三角形ABC的面积

mathematica 发表于 2021-3-2 08:29:40

Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
x=Sqrt;(*AP长度*)
ans=Solve[{
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    c1==cs,(*∠BAP的余弦值*)
    c2==cs,(*∠CAP的余弦值*)
    c1^2+s1^2==1,(*余弦正弦的平方和等于1*)
    c2^2+s2^2==1,(*余弦正弦的平方和等于1*)
    Cos==c1*c2-s1*s2,(*∠BAC=60°*)
    c>0&&b>0&&c1>0&&s1>0&&c2>0&&s2>0(*过滤条件,限制变量范围*)
},{c,b,c1,s1,c2,s2}]//FullSimplify
(*计算面积*)
aaa=1/2*b*c*Sin/.ans//FullSimplify

思路写在代码里面
\[\left\{\left\{c\to \frac{1}{2} \left(5 \sqrt{13}+9\right),b\to \sqrt{13}+6,\text{c1}\to \frac{3 \sqrt{\frac{3}{13}}}{2},\text{s1}\to \frac{5}{2 \sqrt{13}},\text{c2}\to 2 \sqrt{\frac{3}{13}},\text{s2}\to \frac{1}{\sqrt{13}}\right\}\right\}\]
面积
\[\left\{\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right)\right\}\]

mathematica 发表于 2021-3-2 08:51:33

mathematica 发表于 2021-3-2 08:29
思路写在代码里面
\[\left\{\left\{c\to \frac{1}{2} \left(5 \sqrt{13}+9\right),b\to \sqrt{13}+6,\te ...

用解析几何的办法求解!
Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
(*A点为原点,AB=c,AC=b,C点在x轴正方向上,解析几何求解*)
x=Sqrt;(*AP长度*)
{xb,yb}=c*{Cos,Sin};
{xc,yc}={b,0};
ans=Solve[{
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    (xp-0)^2+(yp-0)^2==39,(*AP^2=39*)
    (xp-xb)^2+(yp-yb)^2==10^2,(*BP=10*)
    (xp-xc)^2+(yp-yc)^2==4^2,(*CP=4*)
    c>0&&b>0
},{c,b,xp,yp}]//FullSimplify
(*计算面积*)
aaa=1/2*b*c*Sin/.ans//FullSimplify

求解结果
\[\left\{\left\{c\to \frac{1}{2} \left(5 \sqrt{13}+9\right),b\to \sqrt{13}+6,\text{xp}\to 6,\text{yp}\to \sqrt{3}\right\},\left\{c\to \sqrt{\frac{1}{38} \left(5 \sqrt{7293}+2357\right)},b\to \sqrt{\frac{1}{19} \left(8 \sqrt{7293}+811\right)},\text{xp}\to 4 \sqrt{\frac{39}{19}},\text{yp}\to -3 \sqrt{\frac{13}{19}}\right\}\right\}\]

面积
\[\left\{\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right),\frac{1}{76} \sqrt{\frac{3}{2} \left(22911 \sqrt{7293}+2203247\right)}\right\}\]

mathematica 发表于 2021-3-2 08:59:38

本帖最后由 mathematica 于 2021-3-2 09:39 编辑

利用正弦定理解方程组,也能得到结果,但是算了,这个解法不列了。
Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
AP=Sqrt;(*AP长度*)
(*过P点,做PD垂直于AB与D,做PE垂直于AC与E,PE=x,则PD=2.5*x(角相等)*)
Solve+ArcSin==Pi/3,{x}]

\[\left\{\left\{x\to \sqrt{3}\right\}\right\}\]

northwolves 发表于 2021-3-2 15:36:09



如图:
$sinα=sin(\pi/3-β)=sin\frac{\pi}{3}cosβ-cos\frac{\pi}{3} sinβ=10/4 sinβ->\frac{sqrt3}{2}cosβ=3sinβ->sinβ=\frac{1}{sqrt13}$
$PD=sqrt3,PE=2.5sqrt3$
$AC=sqrt{sqrt39^2-sqrt3^2}+sqrt{4^2-sqrt3^2}=6+sqrt13,AB=sqrt{sqrt39^2-(2.5sqrt3)^2}+sqrt{10^2-(2.5sqrt3)^2)=\frac{9+5 \sqrt{13}}{2}$
$S△ABC=1/2AB*AC*sin\frac{ \pi}{3}=\frac{39sqrt{39}+119sqrt3}{8}$

northwolves 发表于 2021-3-2 18:37:00

开始想用$sin(\alpha+\beta)=sin(\pi/3)$ 和差化积计算发现计算量太大,$sinα=sin(\pi/3-β)$反而计算量小多了

mathematica 发表于 2021-3-3 09:07:25

northwolves 发表于 2021-3-2 15:36
如图:
$sinα=sin(\pi/3-β)=sin\frac{\pi}{3}cosβ-cos\frac{\pi}{3} sinβ=10/4 sinβ->\frac{sqrt ...

我把你的思路mathematica化,把思路交给人类,把计算留给电脑!
不过我的是PD垂直AB,PE垂直AC
Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
{PA,PB,PC}={Sqrt,10,4};(*已知的线段长度*)
(*过P点,做PD垂直于AB与D,做PE垂直于AC与E*)
ans=Solve[{
    PD/PB==PE/PC,(*角相等,所以正弦值也相等*)
    ArcSin+ArcSin==Pi/3,(*两个角相加等于∠BAC=60°*)
    AB==Sqrt+Sqrt,(*勾股定理计算AB长度*)
    AC==Sqrt+Sqrt,(*勾股定理计算AB长度*)
    SABC==1/2*AB*AC*Sin(*三角形ABC的面积*)
},{PD,PE,AB,AC,SABC}]//FullSimplify

求解结果
\[\left\{\left\{\text{PD}\to \frac{5 \sqrt{3}}{2},\text{PE}\to \sqrt{3},\text{AB}\to \frac{1}{2} \left(5 \sqrt{13}+9\right),\text{AC}\to \sqrt{13}+6,\text{SABC}\to \frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right)\right\}\right\}\]

mathematica 发表于 2021-3-3 09:41:03

本帖最后由 mathematica 于 2021-3-3 09:49 编辑

mathematica 发表于 2021-3-3 09:07
我把你的思路mathematica化,把思路交给人类,把计算留给电脑!
不过我的是PD垂直AB,PE垂直AC



(*虽然列方程是正确的,但是软件求解不出来!*)
Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
x=Sqrt;(*AP长度*)
ans=Solve[{
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    ArcCos@cs+ArcCos@cs==Pi/3(*两个角相加等于∠BAC=60°*)
},{c,b}]//FullSimplify
(*计算面积*)
aaa=1/2*b*c*Sin/.ans//FullSimplify

上面的思路是正确的,但是软件求解不出结果,软件太笨了,所以人为把方程多项式化,mathematica最擅长求解多项式。

Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
x=Sqrt;(*AP长度*)
ans=Solve[{
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    c1==cs,(*∠BAP的余弦值*)
    c2==cs,(*∠CAP的余弦值*)
    c1^2+s1^2==1,(*余弦正弦的平方和等于1*)
    c2^2+s2^2==1,(*余弦正弦的平方和等于1*)
    Cos==c1*c2-s1*s2(*∠BAC=60°*)
},{c,b,c1,s1,c2,s2}]//FullSimplify;
Grid
Grid
(*计算面积*)
aaa=1/2*b*c*Sin/.ans//FullSimplify
bbb=1/2*b*c*Sin/.ans//FullSimplify//N


求解结果:
\[\begin{array}{llllll}
c\to \frac{1}{2} \left(-5 \sqrt{13}-9\right) & b\to -\sqrt{13}-6 & \text{c1}\to -\frac{1}{2} \left(3 \sqrt{\frac{3}{13}}\right) & \text{s1}\to -\frac{5}{2 \sqrt{13}} & \text{c2}\to -2 \sqrt{\frac{3}{13}} & \text{s2}\to -\frac{1}{\sqrt{13}} \\
c\to \frac{1}{2} \left(-5 \sqrt{13}-9\right) & b\to -\sqrt{13}-6 & \text{c1}\to -\frac{1}{2} \left(3 \sqrt{\frac{3}{13}}\right) & \text{s1}\to \frac{5}{2 \sqrt{13}} & \text{c2}\to -2 \sqrt{\frac{3}{13}} & \text{s2}\to \frac{1}{\sqrt{13}} \\
c\to \frac{1}{2} \left(9-5 \sqrt{13}\right) & b\to 6-\sqrt{13} & \text{c1}\to \frac{3 \sqrt{\frac{3}{13}}}{2} & \text{s1}\to -\frac{5}{2 \sqrt{13}} & \text{c2}\to 2 \sqrt{\frac{3}{13}} & \text{s2}\to -\frac{1}{\sqrt{13}} \\
c\to \frac{1}{2} \left(9-5 \sqrt{13}\right) & b\to 6-\sqrt{13} & \text{c1}\to \frac{3 \sqrt{\frac{3}{13}}}{2} & \text{s1}\to \frac{5}{2 \sqrt{13}} & \text{c2}\to 2 \sqrt{\frac{3}{13}} & \text{s2}\to \frac{1}{\sqrt{13}} \\
c\to \frac{1}{2} \left(5 \sqrt{13}-9\right) & b\to \sqrt{13}-6 & \text{c1}\to -\frac{1}{2} \left(3 \sqrt{\frac{3}{13}}\right) & \text{s1}\to -\frac{5}{2 \sqrt{13}} & \text{c2}\to -2 \sqrt{\frac{3}{13}} & \text{s2}\to -\frac{1}{\sqrt{13}} \\
c\to \frac{1}{2} \left(5 \sqrt{13}-9\right) & b\to \sqrt{13}-6 & \text{c1}\to -\frac{1}{2} \left(3 \sqrt{\frac{3}{13}}\right) & \text{s1}\to \frac{5}{2 \sqrt{13}} & \text{c2}\to -2 \sqrt{\frac{3}{13}} & \text{s2}\to \frac{1}{\sqrt{13}} \\
c\to \frac{1}{2} \left(5 \sqrt{13}+9\right) & b\to \sqrt{13}+6 & \text{c1}\to \frac{3 \sqrt{\frac{3}{13}}}{2} & \text{s1}\to -\frac{5}{2 \sqrt{13}} & \text{c2}\to 2 \sqrt{\frac{3}{13}} & \text{s2}\to -\frac{1}{\sqrt{13}} \\
c\to \frac{1}{2} \left(5 \sqrt{13}+9\right) & b\to \sqrt{13}+6 & \text{c1}\to \frac{3 \sqrt{\frac{3}{13}}}{2} & \text{s1}\to \frac{5}{2 \sqrt{13}} & \text{c2}\to 2 \sqrt{\frac{3}{13}} & \text{s2}\to \frac{1}{\sqrt{13}}\\
c\to \sqrt{\frac{1}{38} \left(2357-5 \sqrt{7293}\right)} & b\to -\sqrt{\frac{1}{19} \left(811-8 \sqrt{7293}\right)} & \text{c1}\to -\frac{1}{2 \sqrt{19}} & \text{s1}\to -\frac{1}{2} \left(5 \sqrt{\frac{3}{19}}\right) & \text{c2}\to -\frac{4}{\sqrt{19}} & \text{s2}\to \sqrt{\frac{3}{19}} \\
c\to \sqrt{\frac{1}{38} \left(2357-5 \sqrt{7293}\right)} & b\to -\sqrt{\frac{1}{19} \left(811-8 \sqrt{7293}\right)} & \text{c1}\to -\frac{1}{2 \sqrt{19}} & \text{s1}\to \frac{5 \sqrt{\frac{3}{19}}}{2} & \text{c2}\to -\frac{4}{\sqrt{19}} & \text{s2}\to -\sqrt{\frac{3}{19}} \\
c\to -\sqrt{\frac{1}{38} \left(2357-5 \sqrt{7293}\right)} & b\to \sqrt{\frac{1}{19} \left(811-8 \sqrt{7293}\right)} & \text{c1}\to \frac{1}{2 \sqrt{19}} & \text{s1}\to -\frac{1}{2} \left(5 \sqrt{\frac{3}{19}}\right) & \text{c2}\to \frac{4}{\sqrt{19}} & \text{s2}\to \sqrt{\frac{3}{19}} \\
c\to -\sqrt{\frac{1}{38} \left(2357-5 \sqrt{7293}\right)} & b\to \sqrt{\frac{1}{19} \left(811-8 \sqrt{7293}\right)} & \text{c1}\to \frac{1}{2 \sqrt{19}} & \text{s1}\to \frac{5 \sqrt{\frac{3}{19}}}{2} & \text{c2}\to \frac{4}{\sqrt{19}} & \text{s2}\to -\sqrt{\frac{3}{19}} \\
c\to -\sqrt{\frac{5 \sqrt{7293}}{38}+\frac{2357}{38}} & b\to -\sqrt{\frac{1}{19} \left(8 \sqrt{7293}+811\right)} & \text{c1}\to -\frac{1}{2 \sqrt{19}} & \text{s1}\to -\frac{1}{2} \left(5 \sqrt{\frac{3}{19}}\right) & \text{c2}\to -\frac{4}{\sqrt{19}} & \text{s2}\to \sqrt{\frac{3}{19}} \\
c\to -\sqrt{\frac{5 \sqrt{7293}}{38}+\frac{2357}{38}} & b\to -\sqrt{\frac{1}{19} \left(8 \sqrt{7293}+811\right)} & \text{c1}\to -\frac{1}{2 \sqrt{19}} & \text{s1}\to \frac{5 \sqrt{\frac{3}{19}}}{2} & \text{c2}\to -\frac{4}{\sqrt{19}} & \text{s2}\to -\sqrt{\frac{3}{19}} \\
c\to \sqrt{\frac{1}{38} \left(5 \sqrt{7293}+2357\right)} & b\to \sqrt{\frac{1}{19} \left(8 \sqrt{7293}+811\right)} & \text{c1}\to \frac{1}{2 \sqrt{19}} & \text{s1}\to -\frac{1}{2} \left(5 \sqrt{\frac{3}{19}}\right) & \text{c2}\to \frac{4}{\sqrt{19}} & \text{s2}\to \sqrt{\frac{3}{19}} \\
c\to \sqrt{\frac{1}{38} \left(5 \sqrt{7293}+2357\right)} & b\to \sqrt{\frac{1}{19} \left(8 \sqrt{7293}+811\right)} & \text{c1}\to \frac{1}{2 \sqrt{19}} & \text{s1}\to \frac{5 \sqrt{\frac{3}{19}}}{2} & \text{c2}\to \frac{4}{\sqrt{19}} & \text{s2}\to -\sqrt{\frac{3}{19}} \\
\end{array}\]
数值化
\[\begin{array}{llllll}
c\to -13.5139 & b\to -9.60555 & \text{c1}\to -0.720577 & \text{s1}\to -0.693375 & \text{c2}\to -0.960769 & \text{s2}\to -0.27735 \\
c\to -13.5139 & b\to -9.60555 & \text{c1}\to -0.720577 & \text{s1}\to 0.693375 & \text{c2}\to -0.960769 & \text{s2}\to 0.27735 \\
c\to -4.51388 & b\to 2.39445 & \text{c1}\to 0.720577 & \text{s1}\to -0.693375 & \text{c2}\to 0.960769 & \text{s2}\to -0.27735 \\
c\to -4.51388 & b\to 2.39445 & \text{c1}\to 0.720577 & \text{s1}\to 0.693375 & \text{c2}\to 0.960769 & \text{s2}\to 0.27735 \\
c\to 4.51388 & b\to -2.39445 & \text{c1}\to -0.720577 & \text{s1}\to -0.693375 & \text{c2}\to -0.960769 & \text{s2}\to -0.27735 \\
c\to 4.51388 & b\to -2.39445 & \text{c1}\to -0.720577 & \text{s1}\to 0.693375 & \text{c2}\to -0.960769 & \text{s2}\to 0.27735 \\
c\to 13.5139 & b\to 9.60555 & \text{c1}\to 0.720577 & \text{s1}\to -0.693375 & \text{c2}\to 0.960769 & \text{s2}\to -0.27735 \\
c\to 13.5139 & b\to 9.60555 & \text{c1}\to 0.720577 & \text{s1}\to 0.693375 & \text{c2}\to 0.960769 & \text{s2}\to 0.27735\\
c\to 7.12668 & b\to -2.59359 & \text{c1}\to -0.114708 & \text{s1}\to -0.993399 & \text{c2}\to -0.917663 & \text{s2}\to 0.39736 \\
c\to 7.12668 & b\to -2.59359 & \text{c1}\to -0.114708 & \text{s1}\to 0.993399 & \text{c2}\to -0.917663 & \text{s2}\to -0.39736 \\
c\to -7.12668 & b\to 2.59359 & \text{c1}\to 0.114708 & \text{s1}\to -0.993399 & \text{c2}\to 0.917663 & \text{s2}\to 0.39736 \\
c\to -7.12668 & b\to 2.59359 & \text{c1}\to 0.114708 & \text{s1}\to 0.993399 & \text{c2}\to 0.917663 & \text{s2}\to -0.39736 \\
c\to -8.55938 & b\to -8.86802 & \text{c1}\to -0.114708 & \text{s1}\to -0.993399 & \text{c2}\to -0.917663 & \text{s2}\to 0.39736 \\
c\to -8.55938 & b\to -8.86802 & \text{c1}\to -0.114708 & \text{s1}\to 0.993399 & \text{c2}\to -0.917663 & \text{s2}\to -0.39736 \\
c\to 8.55938 & b\to 8.86802 & \text{c1}\to 0.114708 & \text{s1}\to -0.993399 & \text{c2}\to 0.917663 & \text{s2}\to 0.39736 \\
c\to 8.55938 & b\to 8.86802 & \text{c1}\to 0.114708 & \text{s1}\to 0.993399 & \text{c2}\to 0.917663 & \text{s2}\to -0.39736 \\
\end{array}\]

最后面积
\[\left\{\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right),\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right),\frac{1}{8} \sqrt{3} \left(119-39 \sqrt{13}\right),\frac{1}{8} \sqrt{3} \left(119-39 \sqrt{13}\right),\frac{1}{8} \sqrt{3} \left(119-39 \sqrt{13}\right),\frac{1}{8} \sqrt{3} \left(119-39 \sqrt{13}\right),\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right),\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right),-\frac{1}{76} \sqrt{\frac{1}{2} \left(6609741-68733 \sqrt{7293}\right)},-\frac{1}{76} \sqrt{\frac{1}{2} \left(6609741-68733 \sqrt{7293}\right)},-\frac{1}{76} \sqrt{\frac{1}{2} \left(6609741-68733 \sqrt{7293}\right)},-\frac{1}{76} \sqrt{\frac{1}{2} \left(6609741-68733 \sqrt{7293}\right)},\frac{1}{76} \sqrt{\frac{3}{2} \left(22911 \sqrt{7293}+2203247\right)},\frac{1}{76} \sqrt{\frac{3}{2} \left(22911 \sqrt{7293}+2203247\right)},\frac{1}{76} \sqrt{\frac{3}{2} \left(22911 \sqrt{7293}+2203247\right)},\frac{1}{76} \sqrt{\frac{3}{2} \left(22911 \sqrt{7293}+2203247\right)}\right\}\]
数值化
\[\{56.2086,56.2086,-4.68011,-4.68011,-4.68011,-4.68011,56.2086,56.2086,-8.00367,-8.00367,-8.00367,-8.00367,32.8677,32.8677,32.8677,32.8677\}\]

mathematica 发表于 2021-3-4 12:29:10

本帖最后由 mathematica 于 2021-3-4 12:30 编辑

mathematica 发表于 2021-3-3 09:41
上面的思路是正确的,但是软件求解不出结果,软件太笨了,所以人为把方程多项式化,mathematica最擅 ...

Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
x=Sqrt;(*AP长度*)
(*隐函数绘图,红色的表示余弦值相等,蓝色的表示反余弦相加等于60°*)
h1=ContourPlot==cs,{c,-20,20},{b,-20,20},ColorFunction->Hue];
h2=ContourPlot+ArcCos@cs==Pi/3,{c,-20,20},{b,-20,20}];
(*从图上可以看出来有两组实数根*)
Show
(*通过牛顿迭代法找到第1组实数解,然后代数近似得到精确解*)
ans=FindRoot[{
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    ArcCos@cs+ArcCos@cs==Pi/3(*两个角相加等于∠BAC=60°*)
},{{c,-2},{b,1}},WorkingPrecision->100]
aaa={c,b}->RootApproximant[({c,b}/.ans)]
(*验证精确解是不是方程的根*)
bbb={
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    ArcCos@cs+ArcCos@cs==Pi/3(*两个角相加等于∠BAC=60°*)
}/.Thread
ccc=FullSimplify
(*通过牛顿迭代法找到第2组实数解,然后代数近似得到精确解*)
ans=FindRoot[{
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    ArcCos@cs+ArcCos@cs==Pi/3(*两个角相加等于∠BAC=60°*)
},{{c,11},{b,10}},WorkingPrecision->100]
aaa={c,b}->RootApproximant[({c,b}/.ans)]
(*验证精确解是不是方程的根*)
bbb={
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    ArcCos@cs+ArcCos@cs==Pi/3(*两个角相加等于∠BAC=60°*)
}/.Thread
ccc=FullSimplify


可以通过数值解来逼近精确解
两个解分别为
\[\{c,b\}\to \left\{\frac{1}{2} \left(9-5 \sqrt{13}\right),6-\sqrt{13}\right\}\]
上面的解舍弃,下面的解
\[\{c,b\}\to \left\{\frac{1}{2} \left(5 \sqrt{13}+9\right),\sqrt{13}+6\right\}\]

mathematica 发表于 2021-3-9 09:37:28

本帖最后由 mathematica 于 2021-3-9 09:39 编辑

mathematica 发表于 2021-3-4 12:29
可以通过数值解来逼近精确解
两个解分别为
\[\{c,b\}\to \left\{\frac{1}{2} \left(9-5 \sqrt{13 ...

代码稍微修改一下,就能够直接求解反三角函数方程了!
Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
x=Sqrt;(*AP长度*)
ans=Solve[{
    cs==cs,(*两个角相等,因此它们的余弦值也相等*)
    (*求解不出来,换成下面的ArcCos@cs+ArcCos@cs==Pi/3(*两个角相加等于∠BAC=60°*)*)
    Cos/@(ArcCos@cs+ArcCos@cs==Pi/3)(*两个角相加等于∠BAC=60°*)
},{c,b}]//FullSimplify;
Grid
Grid
(*计算面积*)
aaa=1/2*b*c*Sin/.ans//FullSimplify
N@aaa

求解结果
\[\begin{array}{ll}
c\to \frac{1}{2} \left(-5 \sqrt{13}-9\right) & b\to -\sqrt{13}-6 \\
c\to \frac{1}{2} \left(9-5 \sqrt{13}\right) & b\to 6-\sqrt{13} \\
c\to \frac{1}{2} \left(5 \sqrt{13}-9\right) & b\to \sqrt{13}-6 \\
c\to \frac{1}{2} \left(5 \sqrt{13}+9\right) & b\to \sqrt{13}+6 \\
\end{array}\]
数值化
\[\begin{array}{ll}
c\to -13.5139 & b\to -9.60555 \\
c\to -4.51388 & b\to 2.39445 \\
c\to 4.51388 & b\to -2.39445 \\
c\to 13.5139 & b\to 9.60555 \\
\end{array}\]

计算面积
\[\left\{\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right),\frac{1}{8} \sqrt{3} \left(119-39 \sqrt{13}\right),\frac{1}{8} \sqrt{3} \left(119-39 \sqrt{13}\right),\frac{1}{8} \sqrt{3} \left(39 \sqrt{13}+119\right)\right\}\]
数值化
\[\{56.2086,-4.68011,-4.68011,56.2086\}\]

代码的改进来源:
https://bbs.emath.ac.cn/forum.php?mod=redirect&goto=findpost&ptid=17588&pid=86862&fromuid=865
@chyanog
页: [1] 2
查看完整版本: 求三角形ABC的面积