我正在尝试使用 pair[] Intersectionpoints 来查找并标记由路径 h 和路径 g 定义的圆的交点。谢谢您的帮助。
\documentclass{standalone}
\usepackage{asypictureB}
\begin{document}
\begin{asypicture}{name=Label}
import olympiad;
size(7cm);
import graph;
pair A=(0,0);
dot(A);
label("$A$",A,W);
pair C=A+18dir(40);
dot(C);
label("$C$",C,N);
pair D=A+16dir(20);
dot(D);
label("$D$",D,SE);
pair e=A+9dir(20);
dot(e);
label("$E$",e,NE);
pair F=A+8dir(40);
dot(F);
label("$F$",F,W);
path g = circle(A,12);
draw(g);
path h = circumcircle(F,D,C);
pair[] intersectionpoints(path g, path h);
dot(point([0]);
dot(point([1]);
draw(A--C);
draw(A--D);
pair O=circumcenter(F,D,C); // olympiad - circumcenter
dot(O);
label("$O$",O,S);
draw(circumcircle(F,D,C)); // olympiad - circumcircle
\end{asypicture}
\end{document}
答案1
下载opympiad.asy
后本网站,这很容易。我猜你误解了这句话这个很好的教程所以我做了pair[] intersectionpoints(path g, path h);
一些调整,并删除了其他语法错误,以获得
\documentclass{standalone}
\usepackage{asypictureB}
\begin{document}
\begin{asypicture}{name=Label}
import olympiad;
size(7cm);
import graph;
pair A=(0,0);
dot(A);
label("$A$",A,W);
pair C=A+18*dir(40);
dot(C);
label("$C$",C,N);
pair D=A+16*dir(20);
dot(D);
label("$D$",D,SE);
pair e=A+9*dir(20);
dot(e);
label("$E$",e,NE);
pair F=A+8*dir(40);
dot(F);
label("$F$",F,W);
path g = circle(A,12);
draw(g);
path h = circumcircle(F,D,C);
pair[] ipoints = intersectionpoints(g,h);
dot(ipoints[0]);
dot(ipoints[1]);
draw(A--C);
draw(A--D);
pair O=circumcenter(F,D,C); // olympiad - circumcenter
dot(O);
label("$O$",O,S);
draw(h); // olympiad - circumcircle
\end{asypicture}
\end{document}
答案2
只需提及geometry.asy
(包含在 Asymptote 中)提供了大量平面几何例程(三角形、圆形、椭圆形等)和适当的结构。例如,如果C
是圆形,C.C
则为中心,而C.r
为半径。这里是带有软件包的 marmot 答案的复制/粘贴geometry.asy
。
import geometry;
point A=(0,0);
dot(A);
label("$A$",A,W);
point C=A+18*dir(40);
dot(C);
label("$C$",C,N);
point D=A+16*dir(20);
dot(D);
label("$D$",D,SE);
point e=A+9*dir(20);
dot(e);
label("$E$",e,NE);
point F=A+8*dir(40);
dot(F);
label("$F$",F,W);
circle g = circle(A,12);
draw(g);
circle h = circle(F,D,C);
pair[] ipoints = intersectionpoints(g,h);
dot(ipoints[0]);
dot(ipoints[1]);
draw(A--C);
draw(A--D);
point O=h.C; // circle is a structure, h.C the center, h.r the radius
label("$r\approx$"+string(h.r,4),(18,1));
dot(O);
label("$O$",O,S);
draw(h);