找回密码
 欢迎注册
楼主: nyy

[提问] 求半圆的半径?

[复制链接]
 楼主| 发表于 2025-9-23 13:10:51 | 显示全部楼层
王守恩 发表于 2025-9-23 09:56
角度比长度更重要。

Solve[{116/Sin == 144/Sin[c], (2 R)/Sin[b + c] == 95/Cos[2 a - c], (2 R)/Sin[Pi/ ...

看你的代码太费劲了,
你的代码没有注释,
你的代码没有对应的图片。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2025-9-24 09:31:30 | 显示全部楼层
王守恩 发表于 2025-9-23 09:56
角度比长度更重要。

Solve[{116/Sin == 144/Sin[c], (2 R)/Sin[b + c] == 95/Cos[2 a - c], (2 R)/Sin[Pi/ ...

老同志的方程思想不错
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2025-10-22 20:00:48 | 显示全部楼层
方程组太牛逼了
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2025-10-24 12:07:00 | 显示全部楼层
下次有时间把这个代码优化一下
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2025-10-30 12:06:36 | 显示全部楼层
nyy 发表于 2025-10-24 12:07
下次有时间把这个代码优化一下
  1. (*解析几何求解问题*)
  2. Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
  3. (*点坐标初始赋值*)
  4. AA={0,0};
  5. EE={xe,ye};
  6. CC=EE*(87+29)/87;
  7. DD={95,0};
  8. BB={144,0};
  9. OO=(EE+DD)/2;
  10. FF={xf,yf};
  11. (*列方程组解决问题*)
  12. ans=Solve[{
  13.     EuclideanDistance[AA,EE]==87,(*AE=87*)
  14.     EuclideanDistance[EE,OO]==EuclideanDistance[FF,OO]==R,(*OE=OD=OG=R*)
  15.     Dot[OO-FF,CC-BB]==0,(*OF⊥CB,内积等于零*)
  16.     Det[(#~Join~{1})&/@{CC,FF,BB}]==0 (*CFB三点共线*)
  17. },{xe,ye,xf,yf,R}]//FullSimplify
  18. Grid[ans,Alignment->Left](*列表显示*)
  19. Grid[N[ans,10],Alignment->Left](*列表显示*)
复制代码


求解结果
\[\begin{array}{lllll}
\text{xe}\to 63 & \text{ye}\to -60 & \text{xf}\to \frac{531}{5} & \text{yf}\to -\frac{252}{5} & R\to 34 \\
\text{xe}\to 63 & \text{ye}\to 60 & \text{xf}\to \frac{531}{5} & \text{yf}\to \frac{252}{5} & R\to 34 \\
\text{xe}\to \frac{85671}{985} & \text{ye}\to -\frac{2028}{985} & \text{xf}\to \frac{1530351}{16745} & \text{yf}\to -\frac{86268}{16745} & R\to 26 \sqrt{\frac{5}{197}} \\
\text{xe}\to \frac{85671}{985} & \text{ye}\to \frac{2028}{985} & \text{xf}\to \frac{1530351}{16745} & \text{yf}\to \frac{86268}{16745} & R\to 26 \sqrt{\frac{5}{197}} \\
\end{array}\]

结果数值化
\[\begin{array}{lllll}
\text{xe}\to 63.00000000 & \text{ye}\to -60.00000000 & \text{xf}\to 106.2000000 & \text{yf}\to -50.40000000 & R\to 34.00000000 \\
\text{xe}\to 63.00000000 & \text{ye}\to 60.00000000 & \text{xf}\to 106.2000000 & \text{yf}\to 50.40000000 & R\to 34.00000000 \\
\text{xe}\to 86.97563452 & \text{ye}\to -2.058883249 & \text{xf}\to 91.39151986 & \text{yf}\to -5.151866229 & R\to 4.142144421 \\
\text{xe}\to 86.97563452 & \text{ye}\to 2.058883249 & \text{xf}\to 91.39151986 & \text{yf}\to 5.151866229 & R\to 4.142144421 \\
\end{array}\]

点评

nyy
代码的可读性越来越强  发表于 2025-10-30 12:10
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2025-10-30 14:37:09 | 显示全部楼层
(* 方法1:计算三角形面积 *)
ArePointsCollinear[pts_List] :=
  Det[{pts[[2]] - pts[[1]], pts[[3]] - pts[[1]]}] == 0

(* 示例 *)
points1 = {{1, 1}, {2, 2}, {3, 3}};  (* 共线 *)
points2 = {{1, 1}, {2, 2}, {3, 4}};  (* 不共线 *)

ArePointsCollinear[points1]  (* 输出:True *)
ArePointsCollinear[points2]  (* 输出:False *)

(* 方法2:面积法 *)
AreCollinearByArea[pts_List] :=
  Area[Triangle[pts]] == 0

(* 或者直接计算 *)
AreCollinearByArea2[pts_List] :=
  Abs[Det[pts[[2]] - pts[[1]], pts[[3]] - pts[[1]]]] == 0

有不少办法能够判定三个点是否共线
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 7 天前 | 显示全部楼层
越来越觉得方程思想很牛逼!
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

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

GMT+8, 2025-11-7 08:01 , Processed in 0.042707 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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