summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/1overx.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/asymptote/examples/1overx.asy')
-rw-r--r--Master/texmf-dist/doc/asymptote/examples/1overx.asy17
1 files changed, 17 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/asymptote/examples/1overx.asy b/Master/texmf-dist/doc/asymptote/examples/1overx.asy
new file mode 100644
index 00000000000..5d9775d44dc
--- /dev/null
+++ b/Master/texmf-dist/doc/asymptote/examples/1overx.asy
@@ -0,0 +1,17 @@
+import graph;
+size(200,IgnoreAspect);
+
+real f(real x) {return 1/x;};
+
+bool3 branch(real x)
+{
+ static int lastsign=0;
+ if(x == 0) return false;
+ int sign=sgn(x);
+ bool b=lastsign == 0 || sign == lastsign;
+ lastsign=sign;
+ return b ? true : default;
+}
+
+draw(graph(f,-1,1,branch));
+axes("$x$","$y$",red);