diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /graphics/asymptote/examples/gamma.asy |
Initial commit
Diffstat (limited to 'graphics/asymptote/examples/gamma.asy')
-rw-r--r-- | graphics/asymptote/examples/gamma.asy | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/graphics/asymptote/examples/gamma.asy b/graphics/asymptote/examples/gamma.asy new file mode 100644 index 0000000000..f92dd775ab --- /dev/null +++ b/graphics/asymptote/examples/gamma.asy @@ -0,0 +1,24 @@ +import graph; +size(300,IgnoreAspect); + +bool3 branch(real x) +{ + static int lastsign=0; + if(x <= 0 && x == floor(x)) return false; + int sign=sgn(gamma(x)); + bool b=lastsign == 0 || sign == lastsign; + lastsign=sign; + return b ? true : default; +} + +draw(graph(gamma,-4,4,n=2000,branch),red); + +scale(false); +xlimits(-4,4); +ylimits(-6,6); +crop(); + +xaxis("$x$",RightTicks(NoZero)); +yaxis(LeftTicks(NoZero)); + +label("$\Gamma(x)$",(1,2),red); |