diff options
author | Karl Berry <karl@freefriends.org> | 2019-10-16 20:55:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-10-16 20:55:44 +0000 |
commit | abc0bc868286ffdfc3b7d6e0717cd7b2c35f7d6a (patch) | |
tree | 0af60efa125372c1240326e4b775264cfbcc3eb4 /Master/texmf-dist/doc/latex/circuit-macros/examples/Zcos.m4 | |
parent | a6439a9cf26d146fb436c26e141a900ee2152007 (diff) |
circuit-macros (16oct19)
git-svn-id: svn://tug.org/texlive/trunk@52410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/circuit-macros/examples/Zcos.m4')
-rw-r--r-- | Master/texmf-dist/doc/latex/circuit-macros/examples/Zcos.m4 | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/circuit-macros/examples/Zcos.m4 b/Master/texmf-dist/doc/latex/circuit-macros/examples/Zcos.m4 new file mode 100644 index 00000000000..cbf63fd8f39 --- /dev/null +++ b/Master/texmf-dist/doc/latex/circuit-macros/examples/Zcos.m4 @@ -0,0 +1,29 @@ +.PS +# Zcos.m4 +gen_init +NeedDpicTools + +# define f1 { ee = expe(8*x*`$1'*(x^2 - (`$1')^2)); +# $2 = ee + 1/ee + 2*cos(2*x^4 + 2*(`$1')^4 - 12*x^2*(`$1')^2) - 4; +# } + +# alternative: |cos(z^4)| = 1 + define f1 { Z: (x,$1) + Z4: Zprod(Zprod(Z,Z),Zprod(Z,Z)) + $2 = zabs(Zcos(Z4)) - 1 + } + + ni = 200 + for i=10 to ni do { x = i/ni*3 + findroot( f1, 0, 0.2, 1e-8, y ) + P[i-10]: x,y } + np = ni-10 + + for deg=0 to 359 by 45 do { + for i=0 to np do { Z[i]: rot_(P[i].x,P[i].y,deg*dtor_) } + fitcurve(Z,np,thick 2 outlined "blue") + for i=0 to np do { Z[i]: rot_(P[i].x,-P[i].y,deg*dtor_) } + fitcurve(Z,np,thick 2 outlined "blue") + } + +.PE |