% Copyright 2007-2009 by Massimo Redaelli % % This file may be distributed and/or modified % % 1. under the LaTeX Project Public License and/or % 2. under the GNU Public License. % % See the file doc/LICENSE for more details. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Quadripoles \newcommand{\pgfcircdeclarequadpole}[2]{ \pgfdeclareshape{#1} { \anchor{center}{ \northwest \pgf@x=0pt } \savedanchor\northwest{% \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/height}\pgf@y \pgf@y=.5\pgf@y \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length} \pgf@x=.5\pgf@x \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/quadpoles/#1/width}\pgf@x } \anchor{south west}{ \northwest \pgf@y=-\pgf@y } \anchor{north east}{ \northwest \pgf@x=-\pgf@x } \anchor{north west}{ \northwest } \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } \anchor{A2}{ \northwest \pgf@y=-\pgf@y } \anchor{B1}{ \northwest \pgf@x=-\pgf@x } \anchor{A1}{ \northwest } \anchor{B2}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } \anchor{north}{ \northwest \pgf@x=0pt } \anchor{base}{ \northwest \pgf@x=0pt } \backgroundpath{ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} \northwest \pgf@circ@res@up = \pgf@y \pgf@circ@res@down = -\pgf@y \pgf@circ@res@right = -\pgf@x \pgf@circ@res@left = \pgf@x \pgf@circ@Rlen=\pgfkeysvalueof{/tikz/circuitikz/bipoles/length} #2 } } } \pgfcircdeclarequadpole{transformer}{ \def\stretto{.4} \pgfscope \pgfslopedattimetrue \pgfallowupsidedownattimetrue \pgftransformlineattime{.5}{% \pgfpoint% {\stretto\pgf@circ@res@left}% {\pgf@circ@res@up}% }{% \pgfpoint {\stretto\pgf@circ@res@left}% {\pgf@circ@res@down}% } \pgfnode{inductorshape}{center}{}{pgf@inductor1}{\pgfusepath{stroke}} \endpgfscope \pgfscope \pgfslopedattimetrue \pgfallowupsidedownattimetrue \pgftransformlineattime{.5}{% \pgfpoint% {\stretto\pgf@circ@res@right}% {\pgf@circ@res@down}% }{% \pgfpoint {\stretto\pgf@circ@res@right}% {\pgf@circ@res@up}% } \pgfnode{inductorshape}{center}{}{pgf@inductor2}{\pgfusepath{stroke}} \endpgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpointanchor{pgf@inductor1}{b}} \pgfpathmoveto{\pgfpointanchor{pgf@inductor1}{a}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpointanchor{pgf@inductor2}{a}} \pgfpathmoveto{\pgfpointanchor{pgf@inductor2}{b}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} } \pgfcircdeclarequadpole{gyrator}{ \def\stretto{.4} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\stretto\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfusepath{draw} \pgfsetlinewidth{2\pgflinewidth} \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@left}{.7*\stretto\pgf@circ@res@down}} \pgfpatharc{90}{270}{.7*\stretto\pgf@circ@res@down} \pgfpathmoveto{\pgfpoint{\stretto\pgf@circ@res@right}{.7*\stretto\pgf@circ@res@up}} \pgfpatharc{-90}{90}{.7*\stretto\pgf@circ@res@down} \pgfusepath{draw} }