![如何从点或渐近线路径创建数组](https://linux22.com/image/440829/%E5%A6%82%E4%BD%95%E4%BB%8E%E7%82%B9%E6%88%96%E6%B8%90%E8%BF%91%E7%BA%BF%E8%B7%AF%E5%BE%84%E5%88%9B%E5%BB%BA%E6%95%B0%E7%BB%84.png)
我想根据 Brianchon 定理绘制一幅图。为了使我的代码更简单,我想使用数组,而不是逐点逐行生成。是否可以在一个周期内将点作为数组调用?
谢谢你的帮助。这是我的代码:
settings.outformat="pdf";
import geometry;
size(11cm,0);
conic c2=conic(bqe(1,0,2,2,0,-5));
draw(c2,blue+2bp);
pair F1=(-1-sqrt(3.5),0);
pair F2=(-1+sqrt(3.5),0);
pair p1=point(c2,Relative(0.8));
pair p2=point(c2,Relative(0.6));
pair p3=point(c2,Relative(0.4));
pair p4=point(c2,Relative(0.3));
pair p5=point(c2,Relative(0.1));
pair p6=point(c2,Relative(0.95));
dot("$A$",p1,N);
dot("$B$",p2,NE);
dot("$C$",p3,SE);
dot("$D$",p4,S);
dot("$E$",p5,SW);
dot("$F$",p6,W);
//tangents in the points of ellipse
pair Mn1=p1+dir(p1--F1,p1--F2);
pair Mt1=rotate(90,p1)*Mn1;
path t1= interp(p1,Mt1,-2)--interp(p1,Mt1,2);
draw(t1);
pair Mn2=p2+dir(p2--F2,p2--F1);
pair Mt2=rotate(90,p2)*Mn2;
path t2= interp(p2,Mt2,-2)--interp(p2,Mt2,2);
draw(t2);
pair Mn3=p3+dir(p3--F1,p3--F2);
pair Mt3=rotate(90,p3)*Mn3;
path t3= interp(p3,Mt3,-2)--interp(p3,Mt3,2);
draw(t3);
pair Mn4=p4+dir(p4--F1,p4--F2);
pair Mt4=rotate(90,p4)*Mn4;
path t4= interp(p4,Mt4,-2)--interp(p4,Mt4,2);
draw(t4);
pair Mn5=p5+dir(p5--F1,p5--F2);
pair Mt5=rotate(90,p5)*Mn5;
path t5= interp(p5,Mt5,-2)--interp(p5,Mt5,2);
draw(t5);
pair Mn6=p6+dir(p6--F1,p6--F2);
pair Mt6=rotate(90,p6)*Mn6;
path t6= interp(p6,Mt6,-2)--interp(p6,Mt6,2);
draw(t6);
pair P1 = intersectionpoint(t1,t2);
pair P2 = intersectionpoint(t2,t3);
pair P3 = intersectionpoint(t3,t4);
pair P4 = intersectionpoint(t4,t5);
pair P5 = intersectionpoint(t5,t6);
pair P6 = intersectionpoint(t1,t6);
draw(line(P1,P4),dashed);
draw(line(P2,P5),dashed);
draw(line(P3,P6),dashed);
dot(intersectionpoint(P1--P4,P2--P5),blue+1bp,Fill(red));
shipout(bbox(5mm,invisible));