summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-dart/pst-dart.tex
blob: eac49bddd464f57db7e0882f861428b07f3a5f8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
%% $Id: pst-dart.tex 715 2018-01-28 19:39:51Z herbert $
%%
%% This is file `pst-dart.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-dart.tex'
%%
%% Thomas Söll  <Thomas.Soell@onlinehome.de>
%% Herbert Voss <hvoss@tug.org>
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-dart' is a PSTricks package to plot dart boards
%%
\csname PSTdartLoaded\endcsname
\let\PSTfuncLoaded\endinput
% Requires some PSTricks packages
\ifx\PSTricksLoaded\endinput\else   \input pstricks.tex\fi
\ifx\PSTXKeyLoaded\endinput\else    \input pst-xkey.tex \fi
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
% interface to the `xkeyval' package
\pst@addfams{pst-dart}
%
\def\fileversion{0.01}
\def\filedate{2018/01/27}
\message{`PST-dart' v\fileversion, \filedate\space (ts,hv)}
%
\define@key[psset]{pst-dart}{fontsize}[10pt]{\def\psk@dart@fontsize{\fontsize{#1}{#1}}}
\psset[pst-dart]{fontsize=10pt}

\newcmykcolor{Red}{0 1 1 0}
\newcmykcolor{Green}{1 0 1 0}

\def\psDart{\pst@object{psDart}}%      
\def\psDart@i{\@ifnextchar(\psDart@ii{\psDart@ii(0,0)}}%
\def\psDart@ii(#1){%
  \begingroup
  \addbefore@par{unit=0.1mm}%
  \use@par
  \degrees[20]%
  \rput(#1){%
    \begin{pspicture}(-210,-210)(210,210)%
    \pscircle*(0,0){210}
    % Gerader Part.
    \psset{linewidth=0.5pt}%
    \multido{\rA=-0.5+2.0,\rB=0.5+2.0}{10}{%
      \pswedge*[linecolor=white]{170}{\rA}{!\rA\space 1 add}
      \psarc[linecolor=Green,linewidth=8](0,0){166}{\rA}{!\rA\space 1 add}
      \psarc[linecolor=Red,linewidth=8](0,0){166}{\rB}{!\rB\space 1 add}
      \psarc[linecolor=Green,linewidth=8](0,0){103}{\rA}{!\rA\space 1 add}
      \psarc[linecolor=Red,linewidth=8](0,0){103}{\rB}{!\rB\space 1 add}
      \psline[linecolor=gray!30,dimen=inner,linewidth=0.5pt](170;\rA)(0,0)(170;\rB)
    }%
    \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{170}%
    \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{162}%
    \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{107}
    \pscircle[linecolor=gray!30,dimen=inner,linewidth=0.5pt]{99}
    \pscircle[fillstyle=solid,fillcolor=Green,linecolor=gray!30,linewidth=0.5pt,linecolor=white]{15.9}
    \pscircle[fillstyle=solid,fillcolor=Red,linecolor=gray!30,linewidth=0.5pt,linecolor=white]{6.35}
    \psforeach{\iA}{6,13,4,18,1,20,5,12,9,14,11,8,16,7,19,3,17,2,15,10}{%
       \rput(190;\the\psLoopIndex){\psk@dart@fontsize\selectfont\white\iA}}
  \end{pspicture}}%
  \endgroup
  \ignorespaces
}

%
\catcode`\@=\PstAtCode\relax
%
%% END: pst-dart.tex
\endinput
%