diff options
Diffstat (limited to 'Build/source/utils/asymptote/examples/1overx.asy')
-rw-r--r-- | Build/source/utils/asymptote/examples/1overx.asy | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Build/source/utils/asymptote/examples/1overx.asy b/Build/source/utils/asymptote/examples/1overx.asy new file mode 100644 index 00000000000..5d9775d44dc --- /dev/null +++ b/Build/source/utils/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); |