免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享
返回列表 发帖

很久没用TiKZ画了,尽洪荒之力了

就是为了画初等数学讨论区的 平凡但较难证明的几何题:中点+等线段

尽洪荒之力了,用TiKZ画图的,还更简单的画法么?哦,注意,需加 \usetikzlibrary{calc}。
  1.                 \begin{tikzpicture}[line width=0.75pt]
  2.                         \coordinate [label=right:{$A$}] (a) at (0,0);
  3.                         \coordinate [label=left:{$B$}] (b) at (-2,0);
  4.                         \coordinate [label=right:{$C$}] (c) at (0,4);
  5.                         \draw (a)--(b)--(c)--cycle;
  6.                         \pgfmathsetmacro{\x}{-3}
  7.                         \pgfmathsetmacro{\y}{3}
  8.                         \draw (\x,\y) coordinate[label=left:{$D$}] (d)--(c);
  9.                         \path ($(c)!1!-26.57:(d)$) coordinate (d1);
  10.                         \draw (d)--($(c)!(d)!(d1)$) coordinate [label=above:{$E$}] (e)--(c)--cycle;
  11.                         \draw (d)--(b);
  12.                         \draw[red,fill] ($(d)!0.5!(b)$) coordinate [label=left:{$F$}] (f) circle (1pt);
  13.                         \draw (a)--(f)--(e);
  14.                         \draw[dashed,line width=0.5,blue](a)--(e);
  15.                         \draw[dashed,line width=0.5,blue](f)--($(a)!0.5!(e)$) node[right]{$G$};
  16. \end{tikzpicture}
复制代码
sampe.png
分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友

果然还是 Asymptote 更适合画数学图,这种图 Asymptote 就三五行代码就完事了,而且语法简单。

TOP

回复 2# zhcosin

写来瞧瞧

TOP

回复 2# zhcosin


    画数学几何图,几何画板,,,

TOP

回复 2# zhcosin


    当然,TiKZ的语言是丰富的,我用的仅仅只是最浅层的。理论有对称,旋转命令,只是我不知,我可不能代表TiKZ的“层次”。

   其次,特意找了  Asymptote 作图实例,我个感觉,大体与TiKZ类似,至少语言与用法上。

某个实例的节选如下

//三角形ABC
paira=(2cm,1cm),b=(7cm,3cm),c=(3cm,7cm);
draw(a--b--c--cycle);
//中垂线、外心、外接圆
paird=0.5(a+b),e=0.5(b+c),f=0.5(c+a);
pairo=extension(d,rotate(90,d)*b,e,rotate(90,e)*b);
draw(circle(o,abs(o-a)),red);
draw(o--d,blue);
draw(o--e,blue)
draw(o--f,blue);

TOP

回复 5# isee


    改进,利用几何变换作图——整体画图,部分核心代码
  1.             \begin{tikzpicture}[line width=0.75pt]
  2.                         \draw (0,0)--(0,-4)--(-2,-4) coordinate [label=left:{$B$}] (b) --cycle;
  3.                         \draw[xscale=-1,rotate=86,scale=0.8,red](0,0)--(0,-4)--(-2,-4) coordinate[label=left:{$D$}] (d)--cycle;
  4.                         \draw (d)--(b);
  5.         \end{tikzpicture}
复制代码
sampe2.png

TOP

返回列表 回复 发帖