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/doc/penfunctionimage.asy |
Initial commit
Diffstat (limited to 'graphics/asymptote/doc/penfunctionimage.asy')
-rw-r--r-- | graphics/asymptote/doc/penfunctionimage.asy | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/graphics/asymptote/doc/penfunctionimage.asy b/graphics/asymptote/doc/penfunctionimage.asy new file mode 100644 index 0000000000..38951e550d --- /dev/null +++ b/graphics/asymptote/doc/penfunctionimage.asy @@ -0,0 +1,27 @@ +import palette; + +size(200); + +real fracpart(real x) {return (x-floor(x));} + +pair pws(pair z) { + pair w=(z+exp(pi*I/5)/0.9)/(1+z/0.9*exp(-pi*I/5)); + return exp(w)*(w^3-0.5*I); +} + +int N=512; + +pair a=(-1,-1); +pair b=(0.5,0.5); +real dx=(b-a).x/N; +real dy=(b-a).y/N; + +pen f(int u, int v) { + pair z=a+(u*dx,v*dy); + pair w=pws(z); + real phase=degrees(w,warn=false); + real modulus=w == 0 ? 0: fracpart(log(abs(w))); + return hsv(phase,1,sqrt(modulus)); +} + +image(f,N,N,(0,0),(300,300),antialias=true); |