\begingroup

我想解决x中使用GeometricScene

不幸的是,我不知道如何创建/确认半圆或半圆盘)以及一些约束。

这是一个开始:

scene = GeometricScene[{{a, b, c, d, 
     o}, {x}}, {CircleThrough[{a, b, c}, o], o == Midpoint[{a, c}],
    EuclideanDistance[a, c] == x}];
RandomInstance[scene, RandomSeeding -> 12345]

\endgroup


最佳答案
3

\begingroup

无需表示半圆。仅使用 即可

这是指定场景的一种非常笨拙的方式。当然可以用更简洁的方式表示,但这至少对你来说是一个开始。

scene = GeometricScene[{{o1, o2, o3, b, c}, {x}}, {
    c1 == Circle[o1, 2/2],
    c2 == Circle[o2, 3/2],
    c3 == Circle[o3, x/2],
    GeometricAssertion[{c1, c2}, "Tangent"],
    GeometricAssertion[{c2, InfiniteLine[{o1, b}]}, {"Tangent", b}],
    GeometricAssertion[{c1, c3}, "PairwiseTangent"],
    GeometricAssertion[{o1, o3, b}, "Collinear"],
    GeometricAssertion[InfiniteLine[{o1, o3}], "Horizontal"],
    GeometricAssertion[{Line[{b, o2}], Line[{o2, c}]}, "Perpendicular"],
    GeometricAssertion[{o3, c}, {"OppositeSides", InfiniteLine[{b, o2}]}],
    cc2,
    cc3
    }];
RandomInstance[scene]

GeometricSolveValues[scene, EuclideanDistance[o3, c]]
(* {5/2} *)

\endgroup

2

  • \begingroup
    非常感谢 (\checkmark)!我真希望有一种方法可以指定半个圆盘。毕竟,我们可以在 Graphics 中将圆弧指定为Circle[{0,0},1,{0, Pi}]。哦……猜猜为什么有两票反对?哦,等等:你的答案是错的……应该是 5……而不是 5/2。
    \endgroup


    – 


  • \begingroup
    啊……半径为 5/2,直径为 5 ……好的。
    \endgroup


    – 

\begingroup

DiskSegment通过RegionDisjointRegionWithin,我们可以得到不等式,并使用CylindricalDecomposition得到极端情况。

Clear["Global`*"];
{reg1, reg2, reg3} = {DiskSegment[{1, 0}, 1, {0, Pi}], 
   DiskSegment[{u, 3/2}, 3/2, {π, 2 π}], 
   DiskSegment[{x/2, 0}, x/2, {0, π}]};
sol1 = RegionDisjoint[reg1, reg2]
result1 = 
 ToRules@CylindricalDecomposition[sol1 && u > 0, u, "Boundary"]
u = u /. result1;
sol2 = RegionWithin[reg3, RegionUnion[reg1, reg2]]
result2 = ToRules@CylindricalDecomposition[sol2, x, "Boundary"]
x = x /. result2;

u > 3 || u < -1

{u -> 3}

x >= 5

{x -> 5}

Graphics[{EdgeForm[Black], FaceForm[Pink], reg1, FaceForm[Yellow], 
  reg2, Cyan, Opacity[.1], FaceForm[], reg3}]

  • 上述方法在某些ellipsoid情况下是有效的。
Clear["Global`*"];
{reg1, reg2, reg3} = {Disk[{1, 0}, {1, 2/3}, {0, Pi}], 
   Disk[{u, 2}, {1, 2}, {π, 2 π}], 
   Disk[{x/2, 0}, {x/2, 3/5 x}, {0, π}]};
sol1 = RegionDisjoint[reg1, reg2];
result1 = 
  ToRules@CylindricalDecomposition[sol1 && u > 0, u, "Boundary"];
u = u /. result1;
sol2 = RegionWithin[reg3, RegionUnion[reg1, reg2]];
result2 = ToRules@CylindricalDecomposition[sol2, x, "Boundary"];
x = x /. result2;
Graphics[{EdgeForm[Black], FaceForm[Pink], reg1, FaceForm[Yellow], 
  reg2, Cyan, Opacity[.1], FaceForm[], reg3}]

\endgroup

1

  • \begingroup
    这很有启发性。谢谢你的教育!+1 🙂
    \endgroup


    – 

\begingroup

我投票支持@Domen 的回答。我发布这个答案是因为它相对于 来说“快” GeometricScene(但风格上不如 和 那样令人愉悦,也无法处理复杂的场景GeometricSceneGeometricSolve

c1 = {1, 0};
c2 = {a, 1.5};
c3 = {b, 0};
sol = Quiet@
   Solve[{{-Sin[t], Cos[t]} == {Sin[s], -Cos[s]}, 
      c1 + {Cos[t], Sin[t]} == c2 + 1.5 {Cos[s], Sin[s]}}, {t, s, 
      a}][[2]];
p1 = c1 + {Cos[t], Sin[t]} /. sol;
p2 = {a, 0} /. sol;
p3 = c2 + 1.5 {1, 0} /. sol;
big = Quiet@
   Solve[{c3 + r {-1, 0} == {0, 0}, (c3 - p3) . (c3 - p3) == r^2}, {b,
       r}][[1]];
Graphics[{Pink, EdgeForm[Red], Disk[c1, 1, {0, Pi}], Yellow, 
  Disk[c2 /. sol, 1.5, {Pi, 2 Pi}], Black, 
  Circle[c3 /. big, r /. big, {0, Pi}], Purple, PointSize[0.01], 
  Point[{c1, c2 /. sol, c3 /. big, p1, p3}], Black, 
  Arrowheads[{-0.05, 0.05}], Arrow[{{0, 0}, {5, 0}}], 
  Text[Row[{"Diameter: ", 2 r /. big}], c3 /. big, {0, -2}], 
  Text[c1, c1, {-1, -1}], Text[p1, p1, {-1, -1}], 
  Text[c2 /. sol, c2 /. sol, {-1, -1}], Text[p3, p3, {-1, -1}]}, 
 Frame -> True]

\endgroup

2

  • \begingroup
    我在斯坦福大学教授一门课程,即计算符号数学,这门课程主要讲计算机代数,而对于几何学的章节/部分,我只想使用GeometricScene。因此我请求这样的解决方案。我希望我的学生能够更加熟练地掌握符号几何学。
    \endgroup


    – 

  • \begingroup
    @DavidG.Stork 我很感激。我想我发帖的动机是其他用户可能想以其他方式使用 MMA 来解决此类问题。我尊重您想教授符号几何中高级函数的使用,因此我的回答没有抓住您的要点。正如我所说,我投票支持 Domen 的优秀答案:尽管在我的计算机上需要一些时间。
    \endgroup


    –