mathematica 发表于 2021-6-17 11:09:28

mathematica 发表于 2021-6-17 10:57
进一步优化我的代码,这样更简单易懂

求解结果


从余弦定理出发,消除变量,余弦比值x:y:z,
Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
(*计算余弦值子函数,利用三边计算余弦值*)
cs:=(a^2+b^2-c^2)/(2*a*b)
(*计算三个角的余弦值*)
cosA=cs;
cosB=cs;
cosC=cs;
aaa=Eliminate[{cosA==x/k,cosB==y/k,cosC==z/k},{a,b,c}]


得到关系
\[\frac{2 x y z}{k}+x^2=k^2-y^2-z^2\land k\neq 0\]

王守恩 发表于 2023-6-23 09:09:37

△ABC中 , 已知cosA:cosB:cosC=2:9:12, 求 sinA:sinB:sinC

我还是欣赏hujunhua的解法! 回味无穷!谢谢hujunhua!19楼:

原题等价于求证: 由 2, 9, 12, k 组成的四边形中, 以 k=16 为直径时, 半圆内接四边形有最大面积
\((2*9+12*16)^2=(2^2-16^2)(9^2-16^2)\)
\((12*2+9*16)^2=(12^2-16^2)(2^2-16^2)\)
\((9*12+2*16)^2=(9^2-16^2)(12^2-16^2)\)
3个算式是相通的。

拓展一下。如果我们要求 2, 9, 12, 16 是4个不同的正整数, 可以有
\((2*7+11*14)^2=(2^2-14^2)(7^2-14^2)\)
\((2*9+12*16)^2=(2^2-16^2)(9^2-16^2)\)
\((6*11+14*21)^2=(6^2-21^2)(11^2-21^2)\)
\((1*13+22*26)^2=(1^2-26^2)(13^2-26^2)\)
\((4*14+22*28)^2=(4^2-28^2)(14^2-28^2)\)
\((3*14+25*30)^2=(3^2-30^2)(14^2-30^2)\)
\((8*17+22*32)^2=(8^2-32^2)(17^2-32^2)\)
\((11*17+21*33)^2=(11^2-33^2)(17^2-33^2)\)

只把 k(最大的数)拉出来, 是这样一串数:
14, 16, 21, 26, 28, 30, 32, 33, 35, 38, 42, 44, 48, 51, 52, 54, 55, 57, 60, 62, 63, 64,......

求助! 再大我就来不了了, 求助!这是一串数在OEIS没有的数字串。

王守恩 发表于 2023-6-25 15:31:46

Flatten[ Table]/4, {k,14, 60}]]
{ 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1}
我只想让这串数出来,这些按钮我还是不会用。谢谢northwolves!
14, 16, 21, 26, 28, 30, 32, 33, 35, 38, 42, 44, 48, 51, 52, 54, 55, 56, 57, 60, 62, 63, 64,......
我是一个一个一个一个数出来的,这串数可能错了。
14, 16, 21, 26, 28, 30, 32, 33, 35, 38, 42, 44, 48, 51, 52, 54, 55, 57, 60, 62, 63, 64,......

northwolves 发表于 2023-6-25 17:49:20

Select,
Length@FindInstance[{(2 x*y*z)/# + x^2 + y^2 + z^2 == #^2,
      0 < x < y < z < #}, {x, y, z}, Integers] > 0 &]

{14,16,21,26,28,30,32,33,35,38}

northwolves 发表于 2023-6-25 21:26:26

Table[{n,
FindInstance[{(2 x*y*z)/n + x^2 + y^2 + z^2 == n^2,
    0 < x < y < z < n}, {x, y, z}, Integers]}, {n, 19998, 20004}]
{{19998, {{x -> 202, y -> 6666, z -> 18786}}}, {19999, {{x -> 2202,
    y -> 8351, z -> 17142}}}, {20000, {{x -> 125, y -> 11096,
    z -> 16570}}}, {20001, {{x -> 59, y -> 11739,
    z -> 16159}}}, {20002, {{x -> 158, y -> 5037,
    z -> 19317}}}, {20003, {{x -> 122, y -> 6723,
    z -> 18798}}}, {20004, {{x -> 3759, y -> 5001, z -> 18084}}}}

nyy 发表于 2023-6-26 08:39:46

northwolves 发表于 2023-6-25 21:26
{{19998, {{x -> 202, y -> 6666, z -> 18786}}}, {19999, {{x -> 2202,
    y -> 8351, z -> 17142}}} ...

你的这是寻找(2 x*y*z)/n + x^2 + y^2 + z^2 == n^2不定方程的整数解。
估计应该有通解

nyy 发表于 2023-6-26 11:40:41

Clear["Global`*"];(*清除所有变量*)
(*子函数,利用三边计算角的余弦值,角是c边所对的角*)
cs:=((a^2+b^2-c^2)/(2*a*b))
(*余弦定理计算三个角的余弦值*)
cosA=cs
cosB=cs
cosC=cs
(*根据比例列方程,求解出另外两个边的长度*)
ans=Solve

求解结果
{{a->4 & b-> 5 & c->6}}

王守恩 发表于 2023-6-27 08:19:26

northwolves 发表于 2023-6-25 21:26
{{19998, {{x -> 202, y -> 6666, z -> 18786}}}, {19999, {{x -> 2202,
    y -> 8351, z -> 17142}}} ...
20005, {{x -> 4005, y -> 8556, z -> 16004}, {x -> 4005, y -> 12003, z -> 13277}}
20006, {{x -> 685, y -> 7145, z -> 18431}, {x -> 1429, y -> 13129, z -> 14119}, {x -> 2858, y -> 3542, z -> 18982}, {x -> 2858,y -> 4019, z -> 18823},
{x -> 2858, y -> 10003,z -> 15719}, {x -> 2858, y -> 10597, z -> 15281}, {x -> 3542, y -> 4019, z -> 18577}, {x -> 3542, y -> 9397, z -> 15719},
{x -> 3542, y -> 10003, z -> 15281}, {x -> 3756,y -> 6902, z -> 17148}, {x -> 4019, y -> 10003,z -> 14963}, {x -> 5716, y -> 8666, z -> 14804}, {x -> 9397, y -> 10003, z -> 10597}}
20007, {{x -> 39, y -> 13068, z -> 15124}, {x -> 57, y -> 4446,z -> 19494}, {x -> 117, y -> 4503, z -> 19467}, {x -> 234, y -> 6289, z -> 18918}, {x -> 405, y -> 7657,z -> 18325}, ...
20008, {{x -> 82, y -> 5002, z -> 19352}, {x -> 408, y -> 6150,z -> 18910}, {x -> 492, y -> 9028, z -> 17628}, {x -> 800, y -> 3608, z -> 19520}, {x -> 1308, y -> 8856,z -> 17324}, ...
20009, {{x -> 749, y -> 11031, z -> 16269}, {x -> 963, y -> 13277, z -> 14313}, {x -> 1159, y -> 9163, z -> 17227}, {x -> 1177,y -> 2023, z -> 19753}, {x -> 1177, y -> 4633, z -> 19159}, ...
20010, {{x -> 69, y -> 5307, z -> 19275}, {x -> 276, y -> 8700, z -> 17898}, {x -> 290, y -> 12190, z -> 15690}, {x -> 406, y -> 2001, z -> 19865}, {x -> 406, y -> 12673,z -> 15225}, ...
以后的数都有解吗?好像不对。

{14, 16, 21, 26, 28, 30, 32, 33, 35, 38, 42, 44, 48, 51, 52, 54, 55, 56, 57, 60, 62, 63, 64, 65, 66, 68, 70, 72, 74, 75, 76, 77, 78, 80, 81, 84, 85, 86, 87, 88, 90, 91, 92, 95, 96, 98, 99,
102, 104, 105, 108, 110, 112, 114, 115, 117, 120, 122, 123, 124, 125, 126, 128, 129, 130, 132, 133, 134, 135, 136, 140, 141, 143, 144, 145, 146, 147, 148, 150, 152, 153, 154, 155,
156, 158, 160, 161, 162, 165, 168, 170, 171, 172, 174, 175, 176, 177, 180, 182, 183, 184, 185, 186, 187, 188, 189, 190, 192, 194, 195, 196, 198, 200, 201, 203, 204, 205, 206, ......
这串数没有通项公式,我们可有"方法"显示这里没有的数?

northwolves 发表于 2023-6-27 11:57:06

Complement[
Range@70, {14, 16, 21, 26, 28, 30, 32, 33, 35, 38, 42, 44, 48, 51,
52, 54, 55, 56, 57, 60, 62}]

{1,2,3,4,5,6,7,8,9,10,11,12,13,15,17,18,19,20,22,23,24,25,27,29,31,34,36,37,39,40,41,43,45,46,47,49,50,53,58,59,61,63,64,65,66,67,68,69,70}
页: 1 2 3 [4]
查看完整版本: 一道三角形的题目