CircuiTikZ 中的鏡像天線符號

CircuiTikZ 中的鏡像天線符號

我想將左到右改為antenna右到左,因為接收器需要發射天線的鏡像。

這是我的簡化程式碼

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{tikz}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes,arrows}
\tikzstyle{block} = [draw, fill=white, rectangle, 
    minimum height=3em, minimum width=4em]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,t,black}]
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node[block](tx){transmitter};
\node[antenna,right of =tx,xshift=-0.8 cm] {};
\node[block,right of =tx,xshift=5 cm](rx){reciver};
\node[antenna,left of =rx] {};
\end{tikzpicture}
\end{document}

答案1

您可以使用xscale=-1沿著 - 方向鏡像天線x

這是精煉的程式碼,我在其中使用了positioning庫的正確語法,而\tikzset不是tikzstyle(已棄用)。

\documentclass[12pt,a4paper]{article}
\usepackage{circuitikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes,arrows}
\tikzset{block/.style = {draw, fill=white, rectangle,
                  minimum height=3em, minimum width=2cm},
        input/.style = {coordinate},
        output/.style = {coordinate},
        pinstyle/.style = {pin edge={to-,t,black}}
    }
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{tikzpicture}[auto, node distance=2cm,>=latex']
\node[block](tx){transmitter};
\node[antenna] at (tx.east) {};
\node[block,right = 5cm of tx](rx){receiver};
\node[antenna,xscale=-1] at (rx.west) {};
\end{tikzpicture}
\end{document}

在此輸入影像描述

相關內容