summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/buildcycle.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/buildcycle.asy')
-rw-r--r--Master/texmf-dist/doc/asymptote/examples/buildcycle.asy22
1 files changed, 22 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/buildcycle.asy b/Master/texmf-dist/doc/asymptote/examples/buildcycle.asy
new file mode 100644
index 00000000000..e4e7f8c7c96
--- /dev/null
+++ b/Master/texmf-dist/doc/asymptote/examples/buildcycle.asy
@@ -0,0 +1,22 @@
+size(200);
+
+real w=1.35;
+
+path[] p;
+for(int k=0; k < 2; ++k) {
+ int i=2+2*k;
+ int ii=i^2;
+ p[k]=(w/ii,1){1,-ii}::(w/i,1/i)::(w,1/ii){ii,-1};
+}
+
+path q0=(0,0)--(w,0.5);
+path q1=(0,0)--(w,1.5);
+draw(q0); draw(p[0]); draw(q1); draw(p[1]);
+path s=buildcycle(q0,p[0],q1,p[1]);
+fill(s,mediumgrey);
+
+label("$P$",intersectionpoint(p[0],q0),N);
+label("$Q$",intersectionpoint(p[0],q1),E);
+label("$R$",intersectionpoint(p[1],q1),W);
+label("$S$",intersectionpoint(p[1],q0),S);
+label("$f > 0$",0.5*(min(s)+max(s)),UnFill);