mathematica 发表于 2020-6-3 16:08:16

lsr314 发表于 2020-6-3 15:49
三角形三个角都小于120°的情况下,费马点到三个顶点的距离之和为$L=sqrt((a^2+b^2+c^2)/2+2sqrt(3)S)$.
...

为什么我用mathematica算出来的结果表达式很复杂,你的长度之和是怎么推导出来的,你的S又是什么意思?

mathematica 发表于 2020-6-3 16:13:24

lsr314 发表于 2020-6-3 15:49
三角形三个角都小于120°的情况下,费马点到三个顶点的距离之和为$L=sqrt((a^2+b^2+c^2)/2+2sqrt(3)S)$.
...

Clear["Global`*"];
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
(*解方程组,三边都是120,根据三边长来表示费马点到三个顶点的距离*)
ans=Solve[{
    cs==-1/2&&
    cs==-1/2&&
    cs==-1/2
},{x,y,z}]
(*求解费马点到三个顶点的距离和,并且化简*)
((x+y+z)/.ans)//FullSimplify


求解结果:
\[\left\{\frac{\sqrt{\frac{2 c^6+\left(b^2-5 a^2\right) c^4+\left(4 a^4-3 b^2 a^2+b^4\right) c^2+\left(a^2-b^2\right)^2 \left(-\left(a^2-2 b^2\right)\right)-\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}}{a^4-\left(b^2+c^2\right) a^2+b^4+c^4-b^2 c^2}} \left(\left(b^2+c^2\right) \sqrt{3} a^6-2 \sqrt{3} \left(b^4+c^2 b^2+c^4\right) a^4+\left(b^6+2 c^2 b^4+2 c^4 b^2+c^6\right) \sqrt{3} a^2+2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)} a^2-\sqrt{3} b^2 c^2 \left(b^4+c^4\right)-b^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}-c^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}\right)}{2 \sqrt{2} (a-b) (a+b) (a-c) (a+c) \left(a^4-2 \left(b^2+c^2\right) a^2+b^4+c^4+b^2 c^2\right)},\frac{\sqrt{\frac{2 c^6+\left(b^2-5 a^2\right) c^4+\left(4 a^4-3 b^2 a^2+b^4\right) c^2+\left(a^2-b^2\right)^2 \left(-\left(a^2-2 b^2\right)\right)-\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}}{a^4-\left(b^2+c^2\right) a^2+b^4+c^4-b^2 c^2}} \left(-\sqrt{3} \left(b^2+c^2\right) a^6+2 \left(b^4+c^2 b^2+c^4\right) \sqrt{3} a^4-\sqrt{3} \left(b^6+2 c^2 b^4+2 c^4 b^2+c^6\right) a^2-2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)} a^2+b^2 c^2 \left(b^4+c^4\right) \sqrt{3}+b^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}+c^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}\right)}{2 \sqrt{2} (a-b) (a+b) (a-c) (a+c) \left(a^4-2 \left(b^2+c^2\right) a^2+b^4+c^4+b^2 c^2\right)},\frac{\sqrt{\frac{2 c^6+\left(b^2-5 a^2\right) c^4+\left(4 a^4-3 b^2 a^2+b^4\right) c^2+\left(a^2-b^2\right)^2 \left(-\left(a^2-2 b^2\right)\right)+\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}}{a^4-\left(b^2+c^2\right) a^2+b^4+c^4-b^2 c^2}} \left(\left(b^2+c^2\right) \sqrt{3} a^6-2 \sqrt{3} \left(b^4+c^2 b^2+c^4\right) a^4+\left(b^6+2 c^2 b^4+2 c^4 b^2+c^6\right) \sqrt{3} a^2-2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)} a^2-\sqrt{3} b^2 c^2 \left(b^4+c^4\right)+b^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}+c^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}\right)}{2 \sqrt{2} (a-b) (a+b) (a-c) (a+c) \left(a^4-2 \left(b^2+c^2\right) a^2+b^4+c^4+b^2 c^2\right)},-\frac{\sqrt{\frac{2 c^6+\left(b^2-5 a^2\right) c^4+\left(4 a^4-3 b^2 a^2+b^4\right) c^2+\left(a^2-b^2\right)^2 \left(-\left(a^2-2 b^2\right)\right)+\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}}{a^4-\left(b^2+c^2\right) a^2+b^4+c^4-b^2 c^2}} \left(\left(b^2+c^2\right) \sqrt{3} a^6-2 \sqrt{3} \left(b^4+c^2 b^2+c^4\right) a^4+\left(b^6+2 c^2 b^4+2 c^4 b^2+c^6\right) \sqrt{3} a^2-2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)} a^2-\sqrt{3} b^2 c^2 \left(b^4+c^4\right)+b^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}+c^2 \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a-b-c) (a+b-c) (a+c)^2 (a-b+c) (a+b+c)}\right)}{2 \sqrt{2} (a-b) (a+b) (a-c) (a+c) \left(a^4-2 \left(b^2+c^2\right) a^2+b^4+c^4+b^2 c^2\right)}\right\}\]

结果不是一般的复杂,你的太简单了

mathematica 发表于 2020-6-3 16:18:56

本帖最后由 mathematica 于 2020-6-3 16:21 编辑

lsr314 发表于 2020-6-3 15:49
三角形三个角都小于120°的情况下,费马点到三个顶点的距离之和为$L=sqrt((a^2+b^2+c^2)/2+2sqrt(3)S)$.
...
Clear["Global`*"];
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
(*解方程组,三边都是120,根据三边长来表示费马点到三个顶点的距离*)
ans=Solve[{
    cs==-1/2&&
    cs==-1/2&&
    cs==-1/2
},{x,y,z}]
(*求解费马点到三个顶点的距离和(结果平方以下,更简单!),并且化简*)
f=((x+y+z)^2/.ans)//FullSimplify
ff=Transpose[{f}]//Grid


\[\begin{array}{c}
\frac{1}{2} \left(a^2+b^2+c^2\right)+\frac{\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a+c)^2 (a-b-c) (a+b-c) (a-b+c) (a+b+c)}}{2 (a-b) (a+b) (a-c) (a+c)} \\
\frac{1}{2} \left(a^2+b^2+c^2\right)+\frac{\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a+c)^2 (a-b-c) (a+b-c) (a-b+c) (a+b+c)}}{2 (a-b) (a+b) (a-c) (a+c)} \\
\frac{1}{2} \left(a^2+b^2+c^2\right)-\frac{\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a+c)^2 (a-b-c) (a+b-c) (a-b+c) (a+b+c)}}{2 (a-b) (a+b) (a-c) (a+c)} \\
\frac{1}{2} \left(a^2+b^2+c^2\right)-\frac{\sqrt{3} \sqrt{-(a-b)^2 (a+b)^2 (a-c)^2 (a+c)^2 (a-b-c) (a+b-c) (a-b+c) (a+b+c)}}{2 (a-b) (a+b) (a-c) (a+c)} \\
\end{array}\]



这个是距离和平方后的表达式,看起来还算马虎

mathematica 发表于 2020-6-3 16:38:55

@lsr314
我想知道的是你如何推导出来的?

lsr314 发表于 2020-6-3 16:42:30

mathematica 发表于 2020-6-3 16:38
@lsr314
我想知道的是你如何推导出来的?

我百度的:)

mathematica 发表于 2020-6-3 16:48:46

lsr314 发表于 2020-6-3 16:42
我百度的

我找到回答了,有时候数学思维比mathematica软件更重要,这完全就是一个能手工推导出来的公式

三角形内费马点到三个顶点的距离和与三边有什么关系?
请用A,B,C代表三边,分类讨论(注意内角不一定比120度小).

https://www.zybang.com/question/096f54e81949f933e3d31a4577013d43.html

mathematica 发表于 2020-6-3 16:51:28

lsr314 发表于 2020-6-3 16:42
我百度的

良好的数学概念,比数学软件更重要,
数学软件就是个鸦片,我现在吸鸦片上瘾,
总想着靠计算机来解决问题,
但是计算机不会思考!
不懂得如何去化简。
看来人的思考、mathematica、搜索引擎要结合起来使用!

chyanog 发表于 2020-6-3 18:06:34

mathematica 发表于 2020-6-3 16:08
为什么我用mathematica算出来的结果表达式很复杂,你的长度之和是怎么推导出来的,你的S又是什么意思?

Simplify@@@{{x,y,c},{y,z,a},{z,x,b}}==-1/2&&L==x+y+z,{L},{x,y,z}],
16S^2==(a+b-c) (a-b+c) (-a+b+c) (a+b+c)]//PowerExpand
\(\left\{\left\{L\to -\frac{\sqrt{a^2+b^2+c^2-4 \sqrt{3} S}}{\sqrt{2}}\right\},\left\{L\to \frac{\sqrt{a^2+b^2+c^2-4 \sqrt{3} S}}{\sqrt{2}}\right\},\left\{L\to -\frac{\sqrt{a^2+b^2+c^2+4 \sqrt{3} S}}{\sqrt{2}}\right\},\left\{L\to \frac{\sqrt{a^2+b^2+c^2+4 \sqrt{3} S}}{\sqrt{2}}\right\}\right\}\)

mathematica 发表于 2020-6-4 07:18:44

chyanog 发表于 2020-6-3 18:06
\(\left\{\left\{L\to -\frac{\sqrt{a^2+b^2+c^2-4 \sqrt{3} S}}{\sqrt{2}}\right\},\left\{L\to \fr ...

Solve @@@ {{x, y,
      c}, {y, z, a}, {z, x, b}} == -1/2 && L == x + y + z, {L}, {x, y,
   z}]
这个里面{L}, {x, y, z}是什么意思?为什么把求解的变量放在两个大括号里面

mathematica 发表于 2020-6-5 09:32:50

chyanog 发表于 2020-6-3 18:06
\(\left\{\left\{L\to -\frac{\sqrt{a^2+b^2+c^2-4 \sqrt{3} S}}{\sqrt{2}}\right\},\left\{L\to \fr ...

mathematica帮助文件搜索tutorial/EliminatingVariables
然后就是了,可以用solve消除变量
页: 1 2 [3]
查看完整版本: 又遇上了mathematica的bug