Created
October 2, 2024 01:24
-
-
Save jrzingel/66c91032a5f6d8485161469e3f98224c to your computer and use it in GitHub Desktop.
Directional coupler for circuitikz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass [tikz,border=10pt]{standalone} | |
\usepackage{circuitikz} | |
\begin{document} | |
\newcommand{\dircoupler}[2]{ % #1 = name of object, #2 = rotation angle | |
\draw[thick,rotate=#2] (#1.nw) -- (#1.ne) -- (#1.se) -- (#1.sw) -- cycle; | |
\draw[thick,rotate=#2] (#1.n) -- ++(.3,0) -- ++(0,-0.3); | |
\draw[thick,rotate=#2] (#1.e) -- (#1.w); | |
} | |
\begin{circuitikz} | |
\draw | |
(0,0) to[lamp,color=white,n=DIR,-*] (0,2) % The coupler using a lamp as a template object | |
(DIR.n) -- ++(-1,0) | |
; | |
\dircoupler{DIR}{0} | |
\end{circuitikz} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preview of the coupler when rendered
