\catcode`@=11%
%
\def\VDDcdirvecangle@#1:#2: {%
%   \expandafter\expandafter\expandafter\FPupn\VDDx{#1}{#2 180 div FPpi mul cos}%
%   \expandafter\expandafter\expandafter\FPupn\VDDy{#1}{#2 180 div FPpi mul sin}%
  {%
    \edef\ti{#2}\FPset\angle{\ti}%
    \FPupn\rad{angle 180 div FPpi mul}%
    \FPsincos\VDD@Ay\VDD@Ax\rad
    \VDDgcopy@ ti&:A&
  }%
  \VDDcopy@#1&:ti&
}%
%
\def\VDDcscale@#1:#2:#3 {%
  \expandafter\expandafter\expandafter\FPupn\VDDx{#1}{\VDDx{#2} #3 mul}%
  \expandafter\expandafter\expandafter\FPupn\VDDy{#1}{\VDDy{#2} #3 mul}%
}%
%
\def\VDDcscale#1:#2:#3 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcscale@\VDDparse@tmp:#3
}%
%
\def\VDDclincomb@#1:#2*#3+#4*#5 {%
  \expandafter\expandafter\expandafter
  \FPupn\VDDx{#1}{#2 \VDDx{#3} mul #4 \VDDx{#5} mul add}%
  \expandafter\expandafter\expandafter
  \FPupn\VDDy{#1}{#2 \VDDy{#3} mul #4 \VDDy{#5} mul add}%
}%
%
\def\VDDcavg@#1:#2&#3& {%
  \VDDclincomb@#1:.5*#2+.5*#3
}%
\def\VDDcavg#1:#2 {%
  \VDDparse@\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcavg@\VDDparse@tmp&
}%
%
\def\VDDcadd@#1:#2&#3 {%
  \expandafter\expandafter\expandafter\FPadd\VDDx{#1}{\VDDx{#2}}{\VDDx{#3}}%
  \expandafter\expandafter\expandafter\FPadd\VDDy{#1}{\VDDy{#2}}{\VDDy{#3}}%
}%
%
\def\VDDcsub@#1:#2&#3&#4 {%
  %\message{\#1 -> #1}%
  %\message{\#2 -> #2}%
  %\message{\#3 -> #3}%
  \expandafter\expandafter\expandafter\FPsub\VDDx{#1}{\VDDx{#2}}{\VDDx{#3}}%
  \expandafter\expandafter\expandafter\FPsub\VDDy{#1}{\VDDy{#2}}{\VDDy{#3}}%
  %\message{fnu}%
}%
%
% calculate angle between (1,0) and vector #1
\def\VDDcanglehatx@#1:#2 {%
  %\message{slow}%
  \expandafter\expandafter\expandafter\FPround\VDDx{#2}{\VDDx{#2}}{10}%
  \ifFPzero{\VDDx{#2}}\then
    \ifFPzero{\VDDy{#2}}\then\errmessage{angle undefined}\fi
    \ifFPpos{\VDDy{#2}}\then\def#1{90}\else\def#1{-90}\fi
  \else
    \FPupn#1{\VDDy{#2} \VDDx{#2} div arctan FPpi div 180 mul}%
  \fi
  \ifFPneg{\VDDx{#2}}\then\VDDaddangle@@{#1}{#1}{180}\fi
  %\message{end}%
}%
\def\VDDcanglehaty@#1:#2 {%
  \VDDcanglehatx@\angle:#2
  \FPifgt\angle{-90}
    \FPsub\angle{90}\angle
  \else
    \FPsub\angle{-270}\angle
  \fi
}%
\def\VDDcpanglehatx@#1:#2&#3 {%
  {%
    \VDDcsub@ dirAB:#2&#3&
    \VDDcanglehatx@\angle:dirAB
    \global\let\VDD@tmpi\angle
  }%
  \let#1\VDD@tmpi
}%
\def\VDDcpanglehaty@#1:#2&#3 {%
  {%
    \VDDcsub@ dirAB:#2&#3&
    \VDDcanglehaty@\angle:dirAB
    \global\let\VDD@tmpi\angle
  }%
  \let#1\VDD@tmpi
}%
\def\VDDcanglebetween@#1:#2&#3&#4 {%
  {%
    \VDDcpanglehatx@\angleBC:#3&#4
    \VDDcpanglehatx@\angleBA:#3&#2
    \VDDsubangle@@\angle\angleBA\angleBC
    \global\let\VDD@tmpi\angle
  }%
  \let#1\VDD@tmpi
}%
\def\VDDcangleocenter@#1:#2&#3&#4 {%
  {%
    \VDDcpanglehatx@\angleBC:#3&#4
    \VDDcpanglehatx@\angleBA:#3&#2
    \VDDsubangle@@\angle\angleBC\angleBA
    \ifFPneg{\angle}\then\FPadd\angle\angle{360}\fi
    \FPupn\angle{\angle{} 2 div \angleBA{} add}%
    \VDDnormangle@@\angle
    \global\let\VDD@tmpi\angle
  }%
  \let#1\VDD@tmpi
}%
%
% if fail gracefully if lines are (almost) parallel
\def\VDDcintersect@#1:#2&#3: {%
  {%
    \FPupn\det{%
      \VDDy{#3d} \VDDx{#2d} mul \VDDy{#2d} \VDDx{#3d} mul sub
    }%
    \FPupn\cross{%
      \VDDy{#2p} \VDDy{#3p} sub \VDDx{#2d} mul
      \VDDx{#3p} \VDDx{#2p} sub \VDDy{#2d} mul add
    }%
    \FPupn\comparei{cross abs}%
    \FPupn\compareii{det 10000000 mul abs}%
    \ifFPlt\compareii\comparei\then
      \message{warning: lines are (almost) parallel, outputting bogus point}
      \FPset\parm{1000000}
    \else
      \FPupn\parm{%
         cross det div
      }%
    \fi
    \VDDclincomb@ A:\parm*#3d+1*#3p
    \VDDgcopy@ ti&:A&
  }%
  \VDDcopy@#1&:ti&
}%
\def\VDDcppintersect@#1:#2&#3:#4&#5: {%
  {%
    \VDDdeflinepoint@ l:#2&#3&
    \VDDdeflinepoint@ m:#4&#5&
    \VDDcintersect@ A:l&m:
    \VDDgcopy@ ti&:A&
  }%
  \VDDcopy@#1&:ti&
}%
\def\VDDcrotatequarterrev@#1&#2:#3&#4 {%
  {%
    \VDDcopy@ ti&:#3&
    \VDDcopy@ A&:ti&
    \expandafter\expandafter\expandafter
    \edef\VDDx{B}{\VDDy{A}}%
    \expandafter\expandafter\expandafter
    \FPmul\VDDy{B}{\VDDx{A}}{-1}%
    \VDDgcopy@ ti&:B&
  }%
  \VDDcopy@#1&:ti&
}%
\def\VDDcrotatequarter@#1&#2:#3&#4 {%
  {%
    \VDDcopy@ ti&:#3&
    \VDDcopy@ A&:ti&
    \expandafter\expandafter\expandafter
    \edef\VDDy{B}{\VDDx{A}}%
    \expandafter\expandafter\expandafter
    \FPmul\VDDx{B}{\VDDy{A}}{-1}%
    \VDDgcopy@ ti&:B&
  }%
  \VDDcopy@#1&:ti&
}%
\def\VDDcintersect#1:#2 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#2
  \expandafter\VDDcintersect@\VDDparse@tmp:
}%
\def\VDDccosinusregel#1:#2,#3,#4 {%
  \FPupn#1{2 #2 #2 mul #3 #3 mul add #2 #3 mul #4 180 div FPpi mul cos mul -2 mul add root}%
}%
\def\VDDcppintersect#1:#2:#3 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcppintersect@\VDDparse@tmp:
}%
\def\VDDccrossproduct@#1:#2&#3 {%
  \FPupn#1{\VDDx{#2} \VDDy{#3} mul \VDDy{#2} \VDDx{#3} mul sub}%
}%
\def\VDDcinnerproduct@#1:#2&#3 {%
  \FPupn#1{\VDDx{#2} \VDDx{#3} mul \VDDy{#2} \VDDy{#3} mul add}%
}%
\def\VDDclength@#1:#2 {%
  \VDDcinnerproduct@#1:#2&#2
  \FProot#1{#1}{2}%
}%
\def\VDDcplength@#1:#2&#3& {%
  {%
    \VDDcsub@ diff:#2&#3&
    \VDDclength@\length:diff
    \global\let\VDD@tmpi\length
  }%
  \let#1\VDD@tmpi
}%
\def\VDDcplength#1:#2 {%
  \VDDparse@\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp  }%
  \expandafter\VDDcplength@\expandafter#1\expandafter:\VDDparse@tmp&
}%
\def\VDDcdeellijn@#1&#2:#3&#4&#5&#6 {%
  {%
    \VDDcangleocenter@\angle:#3&#4&#5
    \VDDcdirvecangle@ ld:\angle:
    \VDDgcopy@ ti&:ld&
  }%
  \VDDcopy@ #1p&#1d&:#4&ti&
  \ifx\end#6\end\else\VDDcdeellijn@#2:#4&#5&#6 \fi
}%
\def\VDDccircletangent@ #1&#2:#3&#4:#5: {
  {%
    \VDDdeflinepoint@ l:#5&#3&
    \VDDcleadline@ m&:l&:#3&
    \VDDgcopy@ tmpi&tmpii&:md&mp&
  }%
  \VDDcopy@ #1d&#1p&:tmpi&tmpii&
  \ifx\end#2\end\else\VDDccircletangent@#2:#4:#5: \fi
}%
\def\VDDccircletangent #1:#2:#3 {
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDccircletangent@\VDDparse@tmp:
}%
% #1 bisector, #3 #4 #5 center #4 bisector of rotating #4#3 to #4#5
\def\VDDcbisectorunitdir@#1&#2:#3&#4&#5&#6 {%
  {%
    \VDDcopy@ ti&tii&tiii&B&A&C&:#3&#4&#5&ti&tii&tiii&
    \VDDcsub@ dirAB:C&A&
    \VDDcsub@ dirAC:B&A&
    \VDDcrotatequarter@ perAB&:dirAB&
    \FPupn\dot{%
      \VDDx{dirAB} \VDDx{dirAC} mul \VDDy{dirAB} \VDDy{dirAC} mul add
    }%
    \FPupn\cross{%
      \VDDx{dirAB} \VDDy{dirAC} mul \VDDy{dirAB} \VDDx{dirAC} mul sub
    }%
    \FPupn\lengths{2 \dot{} \dot{} mul \cross{} \cross{} mul add root}%
    \ifFPneg\dot\then
      \FPset\cpar{\cross}%
      \FPsub\cper\lengths\dot
      \FPupn\length{2 2 \VDDx{dirAB} \VDDx{dirAB} mul \VDDy{dirAB} \VDDy{dirAB} add mul \lengths{} mul \cper{} mul root}%
    \else
      \FPupn\length{2 2 \VDDx{dirAB} \VDDx{dirAB} mul \VDDy{dirAB} \VDDy{dirAB} mul add mul \lengths{} mul \lengths{} \dot{} add mul root}%
      \ifFPneg\cross\then
        \FPsub\cpar{-\lengths}{\dot}%
	\FPneg\cper{\cross}%
      \else
        \FPadd\cpar\lengths\dot
	\FPset\cper\cross
      \fi
    \fi
    \FPdiv\cpar\cpar\length
    \FPdiv\cper\cper\length
    %\message{length \length}%
    \VDDclincomb@ ld:\cpar*dirAB+\cper*perAB
    \VDDgcopy@ ti&:ld&
  }%
  \VDDcopy@ #1&:ti&
  \ifx\end#6\end\else\VDDcbisectorunitdir@#2:#4&#5&#6 \fi
}%
% #1 bisector, #3 #4 #5 center #4 bisector of rotating #4#3 to #4#5
\def\VDDcbisector@#1&#2:#3&#4&#5&#6 {%
  {%
    \VDDcopy@ ti&tii&tiii&B&A&C&:#3&#4&#5&ti&tii&tiii&
    \VDDcsub@ dirAB:C&A&
    \VDDcsub@ dirAC:B&A&
    \VDDcrotatequarter@ perAB&:dirAB&
    \FPupn\dot{%
      \VDDx{dirAB} \VDDx{dirAC} mul \VDDy{dirAB} \VDDy{dirAC} mul add
    }%
    \FPupn\cross{%
      \VDDx{dirAB} \VDDy{dirAC} mul \VDDy{dirAB} \VDDx{dirAC} mul sub
    }%
    \FPupn\lengths{2 \dot{} \dot{} mul \cross{} \cross{} mul add root}%
    \ifFPneg\dot\then
      \FPset\cpar{\cross}%
      \FPsub\cper\lengths\dot
    \else
      \ifFPneg\cross\then
        \FPsub\cpar{-\lengths}{\dot}%
	\FPneg\cper{\cross}%
      \else
        \FPadd\cpar\lengths\dot
	\FPset\cper\cross
      \fi
    \fi
    \VDDclincomb@ ld:\cpar*dirAB+\cper*perAB
    \VDDgcopy@ ti&:ld&
  }%
  \VDDcopy@ #1p&#1d&:#4&ti&
  \ifx\end#6\end\else\VDDcbisector@#2:#4&#5&#6 \fi
}%
%% #1 bisector, #3 #4 #5 center #4 bisector of rotating #4#3 to #4#5
%\def\VDDcbisector@#1&#2:#3&#4&#5&#6 {%
%  {%
%    \VDDcopy@ ti&tii&tiii&B&A&C&:#3&#4&#5&ti&tii&tiii&
%    \VDDcsub@ dirAB:C&A&
%    \VDDcsub@ dirAC:B&A&
%    \VDDcrotatequarter@ perAB&:dirAB&
%    % calculate inverse of products of lengths of dirAB and dirAC
%    \FPupn\norm{%
%      1 2
%      \VDDx{dirAB} \VDDx{dirAB} mul \VDDy{dirAB} \VDDy{dirAB} mul add
%      \VDDx{dirAC} \VDDx{dirAC} mul \VDDy{dirAC} \VDDy{dirAC} mul add mul
%      root div
%    }%
%    % normalized inner product
%    \FPupn\cos{%
%      \VDDx{dirAB} \VDDx{dirAC} mul \VDDy{dirAB} \VDDy{dirAC} mul add norm mul
%    }%
%    % normalized outer product
%    \FPupn\sin{%
%      \VDDx{dirAB} \VDDy{dirAC} mul \VDDy{dirAB} \VDDx{dirAC} mul sub norm mul
%    }%
%    \ifFPlt\cos{+.9}\then
%      \FPset\cpar{\sin}%
%      \FPsub\cper{1}{\cos}%
%    \else
%      \ifFPneg\sin\then
%        \FPsub\cpar{-1}{\cos}%
%        \FPneg\cper{\sin}%
%      \else
%        \FPadd\cpar{1}{\cos}%
%        \FPset\cper{\sin}%
%      \fi
%    \fi
%    \VDDclincomb@ ld:\cpar*dirAB+\cper*perAB
%    \VDDgcopy@ ti&:ld&
%  }%
%  \VDDcopy@ #1p&#1d&:#4&ti&
%  \ifx\end#6\end\else\VDDcbisector@#2:#4&#5&#6 \fi
%}%
\def\VDDcbisector#1:#2 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcbisector@\VDDparse@tmp&
}%
\def\VDDcrotatequarter#1:#2 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcrotatequarter@\VDDparse@tmp&
}%
\def\VDDcrotatequarterrev#1:#2 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcrotatequarterrev@\VDDparse@tmp&
}%
\def\VDDcdeellijn#1:#2 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcdeellijn@\VDDparse@tmp&
}%
\def\VDDcleadline@#1&#2:#3&#4:#5&#6 {%
  \VDDcrotatequarter@ #1d&:#3d&
  \VDDcopy@ #1p&:#5&
  \ifx\end#2\end\else\VDDcleadline@#2:#4:#6 \fi
}%
\def\VDDcleadlinepart@#1&#2:#3&#4:#5&#6 {%
  {%
    \VDDcleadline@ m&:l&:#5&
    \VDDcintersect@ A:l&m:
    \VDDgcopy@ ti&:A&
  }%
  \VDDcopy@#1&:ti&
  \ifx\end#2\end\else\VDDcleadlinepart@#2:#4:#6 \fi
}%
\def\VDDcpleadlinepart@#1&#2:#3&#4&#5:#6&#7 {%
  {%
    \VDDdeflinepoint@ l:#3&#4&
    \VDDcleadlinepart@ A&:l&:#6&
    \VDDgcopy@ ti&:A&
  }%
  \VDDcopy@#1&:ti&
}%
\def\VDDcpleadlinepart#1:#2:#3 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcpleadlinepart@\VDDparse@tmp&
}%
\def\VDDcleadline#1:#2:#3 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcleadline@\VDDparse@tmp&
}%
\def\VDDcdeellijnpart@#1&#2:#3&#4&#5&#6 {%
  {%
    \VDDcdeellijn@ l&:#3&#4&#5&
    \VDDdeflinepoint@ m:#3&#5&
    \VDDcintersect@ A:l&m:
    \VDDgcopy@ ti&:A&
  }%
  \VDDcopy@ #1&:ti&
  \ifx\end#6\end\else\VDDcdeellijn@#2:#4&#5&#6 \fi
}%
\def\VDDcdeellijnpart#1:#2 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcdeellijnpart@\VDDparse@tmp&
}%
\def\VDDctranslate@#1&#2:#3&#4:#5&#6& {%
  \VDDcadd@#1:#3&#6
  \VDDcsub@#1:#1&#5&
  \ifx\end#2\end\else\VDDctranslate@#2:#4:#5&#6& \fi
}%
% calc line parallel  B <- A : l : M : \distance
% translate A over l in direction determined by M and l over \distance 
\def\VDDclinepar@ #1:#2:#3:#4:#5 {%
  {%
    \VDDcopy@ ti&tii&tiii&tiv&A&ld&lp&M&:#2&#3d&#3p&#4&ti&tii&tiii&tiv&
    \edef\ti{#5}\FPset\distance{\ti}%
    \VDDcleadline@ m&:l&:lp&
    \VDDclincomb@ D:1*lp+1*md
    \VDDcinnerproduct@\mdref:M&md
    \VDDcinnerproduct@\mdbase:lp&md
    \VDDcinnerproduct@\mdD:D&md
    \FPupn\verdict{\mdref{} \mdbase{} sub \mdD{} \mdbase{} sub mul}%
    \ifFPneg\verdict\then
      \FPneg\distance{\distance}%
    \fi
    \VDDclength@\length:ld
    \FPdiv\distance\distance\length
    \VDDclincomb@ B:1*A+\distance*ld
    \VDDgcopy@ ti&:B&
  }%
  \VDDcopy@#1&:ti&
}%
% #1&#2 list of output point
% #3 current point
% #4 current direction
% #5 sin
% #6 cos
\def\VDDcregularnext@@ #1&#2:#3&#4:#5,#6 {%
  \VDDcrotatequarter@ per&:#4&
  \VDDclincomb@ dir:\cos*#4+\sin*per
  \VDDcadd@ #1:#3&dir
  \ifx\end#2\end\else\VDDcregularnext@@#2:#1&dir:#5,#6 \fi
}%
% rotation
% ( cos(\theta) -sin(\theta) ) (x)
% ( sin(\theta)  cos(\theta) ) (y)
% =
% (x cos(\theta) - y sin(\theta) )
% (x sin(\theta) + y cos(\theta) )
% =
% cos(\theta) * v + sin(\theta) * v_R
\def\VDDcoctagon@#1&#2&#3&#4&#5&#6:#7&#8& {%
  {%
    \VDDcopy@ ti&tii&A&B&:#7&#8&ti&tii&
    \VDDgcopy@ ti&tii&tiii&tiv&tv&tvi&:C&D&E&F&G&H&
    \VDDcsub@ dirAB:B&A&
    \FPsincos\sin\cos{0.7853981634}%
    \VDDcregularnext@@ C&D&E&F&G&H&:B&dirAB:\sin,\cos{}
    \VDDgcopy@ ti&tii&tiii&tiv&tv&tvi&:C&D&E&F&G&H&
  }%
  \VDDcopy@#1&#2&#3&#4&#5&#6&:ti&tii&tiii&tiv&tv&tvi&
}%
\def\VDDchexagon@#1&#2&#3&#4:#5&#6& {%
  {%
    \VDDcopy@ ti&tii&A&B&:#5&#6&ti&tii&
    \VDDgcopy@ ti&tii&tiii&tiv&:C&D&E&F&
    \VDDcsub@ dirAB:B&A&
    \FPsincos\sin\cos{1.047197551}%
    \VDDcregularnext@@ C&D&E&F&:B&dirAB:\sin,\cos{}
    \VDDgcopy@ ti&tii&tiii&tiv&:C&D&E&F&
  }%
  \VDDcopy@#1&#2&#3&#4&:ti&tii&tiii&tiv&
}%
\def\VDDchexagon#1:#2 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDchexagon@\VDDparse@tmp&
}%
\def\VDDcoctagon#1:#2 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcoctagon@\VDDparse@tmp&
}%
\def\VDDcregulartriangle@#1:#2&#3& {%
  {%
    \VDDcopy@ ti&tii&A&B&:#2&#3&ti&tii&
    \VDDcsub@ dirAB:B&A&
    \FPsincos\sin\cos{2.094395102}%
    \VDDcregularnext@@ C&:B&dirAB:\sin,\cos{}
    \VDDgcopy@ ti&:C&
  }%
  \VDDcopy@#1&:ti&
}%
\def\VDDcregulartriangle#1:#2 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcregulartriangle@\VDDparse@tmp&
}%
\def\VDDcpentagon@#1&#2&#3:#4&#5& {%
  {%
    \VDDcopy@ ti&tii&A&B&:#4&#5&ti&tii&
    \VDDcsub@ dirAB:B&A&
    \FPsincos\sin\cos{1.256637061}%
    \VDDcregularnext@@ C&D&E&:B&dirAB:\sin,\cos{}
    %\VDDcrotatequarter@ perAB&:dirAB&
    %\VDDmessage@ dirAB&perAB&
    %\VDDclincomb@ dirBC:\cos*dirAB+\sin*perAB
    %\VDDcrotatequarter@ perBC&:dirBC&
    %\VDDclincomb@ dirCD:\cos*dirBC+\sin*perBC
    %\VDDcrotatequarter@ perCD&:dirCD&
    %\VDDclincomb@ dirDE:\cos*dirCD+\sin*perCD
    %\VDDcadd@ C:B&dirBC
    %\VDDcadd@ D:C&dirCD
    %\VDDcadd@ E:D&dirDE
    \VDDgcopy@ ti&tii&tiii&:C&D&E&
  }%
  \VDDcopy@#1&#2&#3&:ti&tii&tiii&
}%
\def\VDDcpentagon#1:#2 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcpentagon@\VDDparse@tmp&
}%
\def\VDDcsquare@#1&#2:#3&#4& {%
  {%
    \VDDcopy@ ti&tii&A&B&:#3&#4&ti&tii&
    \VDDcsub@ dirAB:A&B&
    \VDDcrotatequarter@ dirAD&:dirAB&
    \VDDcsub@ C:B&dirAD&
    \VDDcsub@ D:A&dirAD&
    \VDDgcopy@ ti&tii&:C&D&
  }%
  \VDDcopy@#1&#2&:ti&tii&
}%
\def\VDDcsquare#1:#2 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcsquare@\VDDparse@tmp&
}%
\def\VDDcpointmul@#1&#2:#3&#4:#5:#6 {%
  {%
    \VDDcopy@ ti&tii&tiii&B&A&M&:#1&#3&#5&ti&tii&tiii&
    \VDDcsub@ dirMA:A&M&
    \VDDclincomb@ B:1*M+#6*dirMA
    \VDDgcopy@ ti&:B&
  }%
  \VDDcopy@#1&:ti&
  \ifx\end#2\end\else\VDDcpointmul@#2:#4:#5:#6 \fi
}%
\def\VDDcpointmul#1:#2:#3:#4 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcpointmul@\VDDparse@tmp:#4
}%
\def\VDDcabstransp@#1&#2:#3&#4:#5&#6:#7 {%
  {%
    \VDDcopy@ ti&tii&tiii&A&B&C&:#3&#5&#6&ti&tii&tiii&
    \edef\ti{#7}\let\distance\ti
    \VDDcsub@ dirBC:C&B&
    \VDDclength@\length:dirBC
    \FPdiv\distance\distance\length
    \VDDclincomb@ D:\distance*dirBC+1*A
    \VDDgcopy@ ti&:D&
  }%
  \VDDcopy@#1&:ti&
  \ifx\end#2\end\else\VDDcabstransp@#2:#4:#5&#6:#7 \fi
}%
\def\VDDcinscribedcircle@#1:#2:#3&#4&#5& {%
  {%
    \VDDcopy@ ti&tii&tiii&A&B&C&:#3&#4&#5&ti&tii&tiii&
    \VDDcdeellijn@ k&l&:A&B&C&A&
    \VDDdeflinepoint@ m:A&B&
    \VDDcintersect@ M:k&l:
    \VDDcleadline@ n&:m&:M&
    \VDDcintersect@ P:m&n:
    \VDDcplength@\length:P&M&
    \VDDgcopy@ ti&:M&
    \global\let\VDD@tmpi\length
  }%
  \VDDcopy@#2&:ti&
  \let#1\VDD@tmpi
}%
\def\VDDcinscribedcircle#1:#2:#3 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcinscribedcircle@\expandafter#1\expandafter:\VDDparse@tmp&
}%
\def\VDDcrotleft@#1&#2:#3&#4:#5&#6 {%
  {
    \VDDcopy@ ti&tii&A&B&:#3&#5&ti&tii&
    \VDDcsub@ D:A&B&
    \VDDcrotatequarterrev@ E&:D&
    \VDDcadd@ F:E&B
    \VDDgcopy@ ti&:F&
  }%
  \VDDcopy@#1&:ti&
  \ifx\end#2\end\else\VDDcrotleft@#2:#4:#6 \fi
}
\def\VDDcrotright@#1&#2:#3&#4:#5&#6 {%
  {
    \VDDcopy@ ti&tii&A&B&:#3&#5&ti&tii&
    \VDDcsub@ D:A&B&
    \VDDcrotatequarter@ E&:D&
    \VDDcadd@ F:E&B
    \VDDgcopy@ ti&:F&
  }%
  \VDDcopy@#1&:ti&
  \ifx\end#2\end\else\VDDcrotright@#2:#4:#6 \fi
}
\def\VDDccircumscribedcircle@#1:#2:#3&#4&#5& {%
  {%
    \VDDcopy@ ti&tii&tiii&A&B&C&:#3&#4&#5&ti&tii&tiii&
    \VDDcavg@ D:A&B&
    \VDDcavg@ E:B&C&
    \VDDdeflinepoint@ k:A&B&
    \VDDdeflinepoint@ l:B&C&
    \VDDcleadline@ m&:k&:D&
    \VDDcleadline@ n&:l&:E&
    \VDDcintersect@ M:m&n:
    \VDDgcopy@ ti&:M&
  }%
  \VDDcopy@#2&:ti&
  \VDDcplength@#1:#2&#3&
}%
\def\VDDccircumscribedcircle#1:#2:#3 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDccircumscribedcircle@\expandafter#1\expandafter:\VDDparse@tmp&
}%
\def\VDDcabstransangle@#1&#2:#3&#4:#5:#6 {%
  {%
    \VDDcopy@ ti&A&:#3&ti&
    \edef\ti{#5}\let\angle\ti
    \edef\ti{#6}\let\distance\ti
    \VDDcdirvecangle@ dir:\angle:
    \VDDclincomb@ D:\distance*dir+1*A
    \VDDgcopy@ ti&:D&
  }%
  \VDDcopy@#1&:ti&
  \ifx\end#2\end\else\VDDcabstransangle@#2:#4:#5:#6 \fi
}%
\def\VDDcabstransangle#1:#2:#3 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \expandafter\VDDcabstransangle@\VDDparse@tmp&:#3
}%
\def\VDDclinepar #1:#2:#3:#4:#5 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@dontcare\VDDparse@tmp#3
  \edef\VDDparse@tmp{\VDDparse@tmp:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#4
  \expandafter\VDDclinepar@\VDDparse@tmp:#5
}%
\def\VDDcabstransp#1:#2:#3:#4 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcabstransp@\VDDparse@tmp:#4
}%
\def\VDDctranslate#1:#2:#3 {%
  \def\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDctranslate@\VDDparse@tmp&
}%
\def\VDDcrotleft#1:#2:#3 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcrotleft@\VDDparse@tmp&
}%
\def\VDDcrotright#1:#2:#3 {%
  \edef\VDDparse@tmp{}%
  \VDDparse@letter\VDDdef@not\VDDparse@tmp#1
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#2
  \edef\VDDparse@tmp{\VDDparse@tmp&:}%
  \VDDparse@letter\VDDdef@\VDDparse@tmp#3
  \expandafter\VDDcrotright@\VDDparse@tmp&
}%
