diff options
author | Karl Berry <karl@freefriends.org> | 2014-01-26 22:14:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-01-26 22:14:21 +0000 |
commit | f743052d85acf7d676d00e1903db1806032ac9f6 (patch) | |
tree | 09ad4bdf5a9a5607a4727be3a8e7adcd23fe2662 /Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex | |
parent | fc11ec42903196eb886eff26e3c251aa47fdd8fb (diff) |
hobby
git-svn-id: svn://tug.org/texlive/trunk@32795 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex b/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex index 5d0f4a91996..37d6a70a6ed 100644 --- a/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex +++ b/Master/texmf-dist/tex/latex/hobby/pgflibraryhobby.code.tex @@ -20,11 +20,22 @@ x/.code={\pgf@x=#1cm}, y/.code={\pgf@y=#1cm} } +\pgfmathparse{atan2(0,1)} +\def\hobby@temp{0.0} +\ifx\pgfmathresult\hobby@temp + \pgfmathdeclarefunction{hobbyatan2}{2}{% + \pgfmathatantwo@{#1}{#2}% + } +\else + \pgfmathdeclarefunction{hobbyatan2}{2}{% + \pgfmathatantwo@{#2}{#1}% + } +\fi \def\hobby@curveto#1#2#3{% \pgfpathcurveto{\hobby@topgf{#1}}{\hobby@topgf{#2}}{\hobby@topgf{#3}}% } -\def\hobby@moveto#1{% - \pgfpathmoveto{\hobby@topgf{#1}}% +\def\hobby@moveto#1#2#3{% + \pgfpathmoveto{\hobby@topgf{#3}}% } \def\hobby@topgf#1{% \pgfqkeys{/pgf/hobby}{#1}% @@ -137,12 +148,12 @@ \advance\pgf@xb by -\pgf@xa \advance\pgf@yb by -\pgf@ya \pgfmathsetmacro\hobby@done{sqrt((\pgf@xb/\hobby@sf)^2 + (\pgf@yb/\hobby@sf)^2)}% - \pgfmathsetmacro\hobby@omegaone{rad(atan2(\pgf@xb,\pgf@yb))}% + \pgfmathsetmacro\hobby@omegaone{rad(hobbyatan2(\pgf@yb,\pgf@xb))}% \hobby@qpoints \advance\pgf@xa by -\pgf@x \advance\pgf@ya by -\pgf@y \pgfmathsetmacro\hobby@dzero{sqrt((\pgf@xa/\hobby@sf)^2 + (\pgf@ya/\hobby@sf)^2)}% - \pgfmathsetmacro\hobby@omegazero{rad(atan2(\pgf@xa,\pgf@ya))}% + \pgfmathsetmacro\hobby@omegazero{rad(hobbyatan2(\pgf@ya,\pgf@xa))}% \pgfmathsetmacro\hobby@psi{\hobby@omegaone - \hobby@omegazero}% \pgfmathsetmacro\hobby@psi{\hobby@psi > pi ? \hobby@psi - 2*pi : \hobby@psi}% \pgfmathsetmacro\hobby@psi{\hobby@psi < -pi ? \hobby@psi + 2*pi : \hobby@psi}% |