mathematica 可以做一些平面几何绘图吗

发布于 2024-10-19 00:35:06 字数 252 浏览 4 评论 0原文

我正在尝试使用计算机来显示一些平面几何图。我不知道什么软件可以做到这一点,或者mathematica是否可以轻松地生成这样的图。

例如,我有以下情节要展示。 给定任意三角形 ABC,设 AD 为平分角 BAC 并与 BC 相交于 D 的线。设 M 为 AD 的中点。让直径为 AB 的圆与 CM 相交于 F。

如何生成这些图并显示 mma 中点的相关标记?容易做吗?有人可以举个例子,或者给出一些关于什么软件最适合此目的的建议吗?

非常感谢。

I am trying to use computer to show some planar geometry plots. I donot know what software can do this, or whether mathematica can produce such plots easily.

For example, I have the following plot to show.
Given any triangle ABC, let AD be the line bisecting angle BAC and intersecting BC at D. Let M be the midpoint of AD. Let the circle whose diameter is AB intersects CM at F.

How to produce these plots and show the relevant labeling of the points in mma? Is it easy to do? Could someone please give an example, or give some recommendation as to what software is best suited for this purposes?

Many thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

淤浪 2024-10-26 00:35:06

在这里,您可以在两分钟内使用几何表达式完成图形。它有许多不错的功能,包括基本几何计算和用于将公式导出到 Mathematica 的界面。

图中的公式是由程序计算出来的。

输入图像描述此处

免费使用,可节省 79 - 99 美元。

Here you have your graph done with Geometry Expressions in two minutes. It has many nice features, including elemental geometry calculations and an interface for exporting formulas to Mathematica.

The formula in the drawing was calculated by the program.

enter image description here

Free to use, $79 - $99 to be able to save.

白龙吟 2024-10-26 00:35:06

这是使用 GeoGebra 解决您所描述的问题的非常快速的解决方案。

这是我第一次使用 GeoGebra,花了我大约 20 分钟来制作 - 所以这个程序制作精良且直观。
此外,它还可以导出到动态的、基于 Java 的网页。这是您指定的问题的问题:TriangleCircle

编辑

对于 Mathematica 演示,Plane Geometry 有很多很好的示例
页面,我找到了其他软件,例如Cabri 几何几何画板

Here's a very quick solution using GeoGebra to the problem you described.

It is the first time I've used GeoGebra and this took me about 20mins to make - so the program is quite well made and intuitive.
What's more, it can export to dynamic, java based, webpages. Here's the one for the problem you specified: TriangleCircle.

Edit

For Mathematica demonstrations, there are lots of good examples at Plane Geometry.
From this page, I found other software such as Cabri Geometry and The Geometer's Sketchpad.

水波映月 2024-10-26 00:35:06

我想我应该展示如何在 Mathematica 中解决这个问题。虽然编码不是最简单的事情,但它确实具有灵活性。另请记住,作者在图形方面相当无能,因此可能有更简单和/或更好的方法来实现。

offset[pt_, center_, eps_] := center + (1 + eps)*(pt - center);

pointfunc[{pt_List, center_List, ptname_String}, siz_, 
   eps_] := {PointSize[siz], Point[pt], 
   Inset[ptname, offset[pt, center, eps]]};

Manipulate[Module[
  {plot1, plot2, plot3, siz = .02, ab = bb - aa, bc = cc - bb, 
   ac = cc - aa, cen = (aa + bb)/2., x, y, soln, dd, mm, ff, lens, 
   pts, eps = .15},
  plot1 = ListLinePlot[{aa, bb, cc, aa}];
  plot2 = Graphics[Circle[cen, Norm[ab]/2.]];
  soln = NSolve[{Norm[ac]*({x, y} - aa).ab - 
       Norm[ab]*({x, y} - aa).ac == 
      0, ({x, y} - cc).({-1, 1}*Reverse[bc]) == 0}, {x, y}];
  dd = {x, y} /. soln[[1]];
  mm = (dd + aa)/2;
  soln = NSolve[{({x, y} - cen).({x, y} - cen) - ab.ab/4 == 
      0, ({x, y} - cc).({-1, 1}*Reverse[mm - cc]) == 0}, {x, y}];
  ff = {x, y} /. soln;
  lens = Map[Norm[# - cc] &, ff];
  ff = If[OrderedQ[lens], ff[[1]], ff[[2]]];
  pts = {{aa, cen, "A"}, {bb, cen, "B"}, {cc, cen, "C"}, {dd, cen, 
     "D"}, {ff, cen, "F"}, {mm, cen, "M"}, {cen, ff, "O"}};
  pts = Map[pointfunc[#, siz, eps] &, pts];
  plot3 = Graphics[Join[pts, {Line[{aa, dd}], Line[{cc, mm}]}]];
  Show[plot1, plot2, plot3, PlotRange -> {{-.2, 1.1}, {-.2, 1.2}}, 
   AspectRatio -> Full, Axes -> False]],
 {{aa, {0, 0}}, {0, 0}, {1, 1}, Locator},
 {{bb, {.8, .7}}, {0, 0}, {1, 1}, Locator},
 {{cc, {.1, 1}}, {0, 0}, {1, 1}, Locator}, 
 TrackedSymbols :> None]

这是一个屏幕截图。

在此处输入图像描述

Daniel Lichtblau
沃尔夫勒姆研究公司

I thought I'd show how one might approach this in Mathematica. While not the simplest thing to code, it does have flexibility. Also bear in mind that the author is fairly inept when it comes to graphics, so there might be easier and/or better ways to go about it.

offset[pt_, center_, eps_] := center + (1 + eps)*(pt - center);

pointfunc[{pt_List, center_List, ptname_String}, siz_, 
   eps_] := {PointSize[siz], Point[pt], 
   Inset[ptname, offset[pt, center, eps]]};

Manipulate[Module[
  {plot1, plot2, plot3, siz = .02, ab = bb - aa, bc = cc - bb, 
   ac = cc - aa, cen = (aa + bb)/2., x, y, soln, dd, mm, ff, lens, 
   pts, eps = .15},
  plot1 = ListLinePlot[{aa, bb, cc, aa}];
  plot2 = Graphics[Circle[cen, Norm[ab]/2.]];
  soln = NSolve[{Norm[ac]*({x, y} - aa).ab - 
       Norm[ab]*({x, y} - aa).ac == 
      0, ({x, y} - cc).({-1, 1}*Reverse[bc]) == 0}, {x, y}];
  dd = {x, y} /. soln[[1]];
  mm = (dd + aa)/2;
  soln = NSolve[{({x, y} - cen).({x, y} - cen) - ab.ab/4 == 
      0, ({x, y} - cc).({-1, 1}*Reverse[mm - cc]) == 0}, {x, y}];
  ff = {x, y} /. soln;
  lens = Map[Norm[# - cc] &, ff];
  ff = If[OrderedQ[lens], ff[[1]], ff[[2]]];
  pts = {{aa, cen, "A"}, {bb, cen, "B"}, {cc, cen, "C"}, {dd, cen, 
     "D"}, {ff, cen, "F"}, {mm, cen, "M"}, {cen, ff, "O"}};
  pts = Map[pointfunc[#, siz, eps] &, pts];
  plot3 = Graphics[Join[pts, {Line[{aa, dd}], Line[{cc, mm}]}]];
  Show[plot1, plot2, plot3, PlotRange -> {{-.2, 1.1}, {-.2, 1.2}}, 
   AspectRatio -> Full, Axes -> False]],
 {{aa, {0, 0}}, {0, 0}, {1, 1}, Locator},
 {{bb, {.8, .7}}, {0, 0}, {1, 1}, Locator},
 {{cc, {.1, 1}}, {0, 0}, {1, 1}, Locator}, 
 TrackedSymbols :> None]

Here is a screen shot.

enter image description here

Daniel Lichtblau
Wolfram Research

微暖i 2024-10-26 00:35:06

Mathematica 并不是最好的软件,尽管它可以解决这个问题。

http://demonstrations.wolfram.com/DrawingATriangle/ 有一个非常漂亮的三角形的源代码,并且按照该示例,您可以在代码中添加一条平分线。

Mathematica isn't the best software for this, although it will work out.

http://demonstrations.wolfram.com/DrawingATriangle/ has source code for a really nice triangle, and following that example you can add a bisecting line to the code.

数理化全能战士 2024-10-26 00:35:06

如前所述,Mathematica 并不是最好的软件。您可以使用几个更好的选项,具体取决于您的具体目的。为了以编程方式生成此类图形,有几种语言特别适合此类任务。我建议尝试 eukleidesGCLC。如果您有使用 TeX/LaTeX 的经验,您可能需要查看 metapostasymptote,甚至是 LaTeX 包,例如 tkz-euklide.

另一方面,如果您更喜欢以交互方式创建绘图,则有许多可用的程序。在网上搜索“动态几何软件”,您应该会得到很多结果。其中我最推荐 geogebra

As already stated, Mathematica is not the best software for this. There are several better options that you can use, depending on your exact purpose. To generate such figures programatically, there are several languages especially adapted for such tasks. I would recommend to try eukleides or GCLC. If you have any experience with TeX/LaTeX, you may want to look at metapost or asymptote, or even a LaTeX package such as tkz-euklide.

If you on the other hand prefer to create you drawings in an interactive way, there are number of programs available. Search the web for "dynamic geometry software", you should get a number of hits. Of those I would most recommend geogebra.

岁月静好 2024-10-26 00:35:06

我认为我真的应该在 Mathematica 中尝试这个问题(只有当我完成后我才看到 Daniel 的解决方案)。我花了大约半个小时 - 这比我的 GeoGebra 解决方案要长,尽管我以前从未使用过 GeoGebra。

该代码并没有想象的那么快。这是因为我懒得编写正确的代码来查找直线和圆的交点,所以我只使用了速度较慢但更通用的 FindInstance

一个相当全面的平面几何包可以作为 Eric Weinstein 的 MathWorld 包 的一部分找到。它包括您可能想要的所有交集、二分等...代码,但需要一点时间来学习所有这些。

angleBisector[A_,{B_,C_}]:=Module[{ba=Norm[B-A],ca=Norm[C-A],m},
  m=A+((B-A)/ba+(C-A)/ca)]

intersect[Line[{A_,B_}],Line[{C_,D_}]]:=Module[{s,t},
  A + s(B-A)/.First@FindInstance[A + s(B-A) == C + t(D-C), {s,t}]]
intersect[Line[{A_,B_}],Circle[p0:{x0_,y0_},r_]]:=Module[{s,x,y},
  A + s(B-A)/.FindInstance[A + s(B-A) == {x,y} 
  && Norm[p0-{x,y}] == r, {s,x,y}, Reals, 2]]

Manipulate[Module[{OO,circ,tri,angB,int,mid,FF},
  OO=(AA+BB)/2;
  circ=Circle[OO,Norm[AA-BB]/2];
  tri=Line[{AA,BB,CC,AA}];
  angB=angleBisector[AA,{BB,CC}];
  int=intersect[Line[{BB,CC}],Line[{AA,angB}]];
  mid=(AA+int)/2;
  FF=intersect[Line[{CC,mid}],Circle[OO,Norm[AA-BB]/2]];
  Graphics[{PointSize[Large],Point[{OO,int,mid}],Point[FF],tri,circ,
    Line[{AA,AA+3(angB-AA)}],Line[{CC,CC+3(mid-CC)}],
    Text["A",AA,{2,-2}],Text["B",BB,{-2,-2}],Text["C",CC,{2,2}],
    Text["O",OO,{0,-2}],Text["D",int,{-2,-1}],Text["M",mid,{-2,-1}]},
    PlotRange->{{-2,2},{-2,2}}]],
  {{AA,{-1,1}},Locator},
  {{BB,{1,1}},Locator},
  {{CC,{0,-1}},Locator}]

TriangleCircle

I thought that I should really attempt this problem in Mathematica (only once I finished did I see Daniel's solution). It took me about half an hour - which is longer than my GeoGebra solution, despite the fact that I'd never used GeoGebra before.

The code is not as fast as it could be. This is because I was too lazy to code up proper code for finding intersections of lines and circles, so I just used the slower but more general FindInstance.

A quite comprehensive plane geometry package can be found as part of Eric Weinstein's MathWorld packages. It includes all the intersection, bisection etc... code that you could possibly want, but it would take a little bit of time to learn it all.

angleBisector[A_,{B_,C_}]:=Module[{ba=Norm[B-A],ca=Norm[C-A],m},
  m=A+((B-A)/ba+(C-A)/ca)]

intersect[Line[{A_,B_}],Line[{C_,D_}]]:=Module[{s,t},
  A + s(B-A)/.First@FindInstance[A + s(B-A) == C + t(D-C), {s,t}]]
intersect[Line[{A_,B_}],Circle[p0:{x0_,y0_},r_]]:=Module[{s,x,y},
  A + s(B-A)/.FindInstance[A + s(B-A) == {x,y} 
  && Norm[p0-{x,y}] == r, {s,x,y}, Reals, 2]]

Manipulate[Module[{OO,circ,tri,angB,int,mid,FF},
  OO=(AA+BB)/2;
  circ=Circle[OO,Norm[AA-BB]/2];
  tri=Line[{AA,BB,CC,AA}];
  angB=angleBisector[AA,{BB,CC}];
  int=intersect[Line[{BB,CC}],Line[{AA,angB}]];
  mid=(AA+int)/2;
  FF=intersect[Line[{CC,mid}],Circle[OO,Norm[AA-BB]/2]];
  Graphics[{PointSize[Large],Point[{OO,int,mid}],Point[FF],tri,circ,
    Line[{AA,AA+3(angB-AA)}],Line[{CC,CC+3(mid-CC)}],
    Text["A",AA,{2,-2}],Text["B",BB,{-2,-2}],Text["C",CC,{2,2}],
    Text["O",OO,{0,-2}],Text["D",int,{-2,-1}],Text["M",mid,{-2,-1}]},
    PlotRange->{{-2,2},{-2,2}}]],
  {{AA,{-1,1}},Locator},
  {{BB,{1,1}},Locator},
  {{CC,{0,-1}},Locator}]

TriangleCircle

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文