找回密码
 欢迎注册
查看: 35526|回复: 29

[讨论] 求三角形ABC的面积

[复制链接]
发表于 2021-3-2 08:28:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?欢迎注册

×
求三角形ABC的面积
QQ截图20210302080432.jpg
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2021-3-2 08:29:40 | 显示全部楼层
  1. Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
  2. (*计算余弦值子函数,利用三边计算余弦值*)
  3. cs[a_,b_,c_]:=(a^2+b^2-c^2)/(2*a*b)
  4. x=Sqrt[39];(*AP长度*)
  5. ans=Solve[{
  6.     cs[c,10,x]==cs[b,4,x],(*两个角相等,因此它们的余弦值也相等*)
  7.     c1==cs[c,x,10],(*∠BAP的余弦值*)
  8.     c2==cs[b,x,4],(*∠CAP的余弦值*)
  9.     c1^2+s1^2==1,(*余弦正弦的平方和等于1*)
  10.     c2^2+s2^2==1,(*余弦正弦的平方和等于1*)
  11.     Cos[60Degree]==c1*c2-s1*s2,(*∠BAC=60°*)
  12.     c>0&&b>0&&c1>0&&s1>0&&c2>0&&s2>0(*过滤条件,限制变量范围*)
  13. },{c,b,c1,s1,c2,s2}]//FullSimplify
  14. (*计算面积*)
  15. aaa=1/2*b*c*Sin[60Degree]/.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\}\]

点评

这个方法不是一般的复杂!  发表于 2021-3-2 09:49
也可以用角的反余弦相加等于60°列方程,但是软件求解不出来,所以就变通一下  发表于 2021-3-2 08:53
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 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 ...

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

点评

这个方法也复杂  发表于 2021-3-2 09:49
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2021-3-2 08:59:38 | 显示全部楼层
本帖最后由 mathematica 于 2021-3-2 09:39 编辑

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

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

点评

这个方法就稍微简单很多了  发表于 2021-3-2 09:50
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2021-3-2 15:36:09 | 显示全部楼层
AB.jpg

如图:
$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}$

点评

个人习惯问题,我是能心算的不笔算,能笔算的就不用软件  发表于 2021-3-3 12:56
解方程的事,应该交给计算机!  发表于 2021-3-3 09:09
二楼我原本是准备用反余弦相加等于60°列方程,但是软件求解不出来,我就变通一下,变成多项式方程组,就能求解出来了  发表于 2021-3-2 17:58
我还发现mathemarica解多项式方程(组)很厉害,要是三角函数方程组,基本就歇菜了!  发表于 2021-3-2 16:01
我喜欢用mathematica解方程,我越用方程,越觉得方程思想太牛逼了!  发表于 2021-3-2 15:58
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2021-3-2 18:37:00 | 显示全部楼层
开始想用$sin(\alpha+\beta)=sin(\pi/3)$ 和差化积计算发现计算量太大,$sinα=sin(\pi/3-β)$反而计算量小多了

点评

在左右两个三角形里面用正弦定理,也能列出方程  发表于 2021-3-2 19:11
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 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
  1. Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
  2. {PA,PB,PC}={Sqrt[39],10,4};(*已知的线段长度*)
  3. (*过P点,做PD垂直于AB与D,做PE垂直于AC与E*)
  4. ans=Solve[{
  5.     PD/PB==PE/PC,(*角相等,所以正弦值也相等*)
  6.     ArcSin[PD/PA]+ArcSin[PE/PA]==Pi/3,(*两个角相加等于∠BAC=60°*)
  7.     AB==Sqrt[PB^2-PD^2]+Sqrt[PA^2-PD^2],(*勾股定理计算AB长度*)
  8.     AC==Sqrt[PC^2-PE^2]+Sqrt[PA^2-PE^2],(*勾股定理计算AB长度*)
  9.     SABC==1/2*AB*AC*Sin[60Degree](*三角形ABC的面积*)
  10. },{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\}\]
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2021-3-3 09:41:03 | 显示全部楼层
本帖最后由 mathematica 于 2021-3-3 09:49 编辑
mathematica 发表于 2021-3-3 09:07
我把你的思路mathematica化,把思路交给人类,把计算留给电脑!
不过我的是PD垂直AB,PE垂直AC

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

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

  1. Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
  2. (*计算余弦值子函数,利用三边计算余弦值*)
  3. cs[a_,b_,c_]:=(a^2+b^2-c^2)/(2*a*b)
  4. x=Sqrt[39];(*AP长度*)
  5. ans=Solve[{
  6.     cs[c,10,x]==cs[b,4,x],(*两个角相等,因此它们的余弦值也相等*)
  7.     c1==cs[c,x,10],(*∠BAP的余弦值*)
  8.     c2==cs[b,x,4],(*∠CAP的余弦值*)
  9.     c1^2+s1^2==1,(*余弦正弦的平方和等于1*)
  10.     c2^2+s2^2==1,(*余弦正弦的平方和等于1*)
  11.     Cos[60Degree]==c1*c2-s1*s2(*∠BAC=60°*)
  12. },{c,b,c1,s1,c2,s2}]//FullSimplify;
  13. Grid[ToRadicals@ans,Alignment->Left]
  14. Grid[N@ans,Alignment->Left]
  15. (*计算面积*)
  16. aaa=1/2*b*c*Sin[60Degree]/.ans//FullSimplify
  17. bbb=1/2*b*c*Sin[60Degree]/.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\}\]

点评

软件求解,产生了很多增根,其实还是像2楼一样,过滤一下比较好,不过过滤后可能产生漏解,所以把所有解全部展示  发表于 2021-3-3 09:54
第八行的求解结果是正确的  发表于 2021-3-3 09:51
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2021-3-4 12:29:10 | 显示全部楼层
本帖最后由 mathematica 于 2021-3-4 12:30 编辑
mathematica 发表于 2021-3-3 09:41
上面的思路是正确的,但是软件求解不出结果,软件太笨了,所以人为把方程多项式化,mathematica最擅 ...

  1. Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
  2. (*计算余弦值子函数,利用三边计算余弦值*)
  3. cs[a_,b_,c_]:=(a^2+b^2-c^2)/(2*a*b)
  4. x=Sqrt[39];(*AP长度*)
  5. (*隐函数绘图,红色的表示余弦值相等,蓝色的表示反余弦相加等于60°*)
  6. h1=ContourPlot[cs[c,10,x]==cs[b,4,x],{c,-20,20},{b,-20,20},ColorFunction->Hue];
  7. h2=ContourPlot[ArcCos@cs[c,x,10]+ArcCos@cs[b,x,4]==Pi/3,{c,-20,20},{b,-20,20}];
  8. (*从图上可以看出来有两组实数根*)
  9. Show[h1,h2]
  10. (*通过牛顿迭代法找到第1组实数解,然后代数近似得到精确解*)
  11. ans=FindRoot[{
  12.     cs[c,10,x]==cs[b,4,x],(*两个角相等,因此它们的余弦值也相等*)
  13.     ArcCos@cs[c,x,10]+ArcCos@cs[b,x,4]==Pi/3(*两个角相加等于∠BAC=60°*)
  14. },{{c,-2},{b,1}},WorkingPrecision->100]
  15. aaa={c,b}->RootApproximant[({c,b}/.ans)]
  16. (*验证精确解是不是方程的根*)
  17. bbb={
  18.     cs[c,10,x]==cs[b,4,x],(*两个角相等,因此它们的余弦值也相等*)
  19.     ArcCos@cs[c,x,10]+ArcCos@cs[b,x,4]==Pi/3(*两个角相加等于∠BAC=60°*)
  20. }/.Thread[aaa]
  21. ccc=FullSimplify[bbb]
  22. (*通过牛顿迭代法找到第2组实数解,然后代数近似得到精确解*)
  23. ans=FindRoot[{
  24.     cs[c,10,x]==cs[b,4,x],(*两个角相等,因此它们的余弦值也相等*)
  25.     ArcCos@cs[c,x,10]+ArcCos@cs[b,x,4]==Pi/3(*两个角相加等于∠BAC=60°*)
  26. },{{c,11},{b,10}},WorkingPrecision->100]
  27. aaa={c,b}->RootApproximant[({c,b}/.ans)]
  28. (*验证精确解是不是方程的根*)
  29. bbb={
  30.     cs[c,10,x]==cs[b,4,x],(*两个角相等,因此它们的余弦值也相等*)
  31.     ArcCos@cs[c,x,10]+ArcCos@cs[b,x,4]==Pi/3(*两个角相加等于∠BAC=60°*)
  32. }/.Thread[aaa]
  33. ccc=FullSimplify[bbb]
复制代码


可以通过数值解来逼近精确解
两个解分别为
\[\{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\}\]

QQ截图20210304123006.jpg

点评

这样求解,还是没有化成多项式方程组求解容易  发表于 2021-3-4 12:35
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 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 ...


代码稍微修改一下,就能够直接求解反三角函数方程了!
  1. Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
  2. (*计算余弦值子函数,利用三边计算余弦值*)
  3. cs[a_,b_,c_]:=(a^2+b^2-c^2)/(2*a*b)
  4. x=Sqrt[39];(*AP长度*)
  5. ans=Solve[{
  6.     cs[c,10,x]==cs[b,4,x],(*两个角相等,因此它们的余弦值也相等*)
  7.     (*求解不出来,换成下面的ArcCos@cs[c,x,10]+ArcCos@cs[b,x,4]==Pi/3(*两个角相加等于∠BAC=60°*)*)
  8.     Cos/@(ArcCos@cs[c,x,10]+ArcCos@cs[b,x,4]==Pi/3)(*两个角相加等于∠BAC=60°*)
  9. },{c,b}]//FullSimplify;
  10. Grid[ans,Alignment->Left]
  11. Grid[N@ans,Alignment->Left]
  12. (*计算面积*)
  13. aaa=1/2*b*c*Sin[60Degree]/.ans//FullSimplify
  14. 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.ph ... 862&fromuid=865
@chyanog

点评

方程原本是有两组解,但是加了一个cos,就四组解了,但是最后实用的还是两组解  发表于 2021-3-9 09:42
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-5-16 02:25 , Processed in 0.062820 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表