![如何在“TikZ”中绘制圆的两条直径?](https://linux22.com/image/394973/%E5%A6%82%E4%BD%95%E5%9C%A8%E2%80%9CTikZ%E2%80%9D%E4%B8%AD%E7%BB%98%E5%88%B6%E5%9C%86%E7%9A%84%E4%B8%A4%E6%9D%A1%E7%9B%B4%E5%BE%84%EF%BC%9F.png)
这是我使用的代码,但我不知道如何\times
在圆圈中放置类似的形状并使圆圈稍微大一点。你能帮忙吗?
我的代码:
\documentclass[tikz,14pt,border=10pt]{standalone}
%%%<
\usepackage{verbatim}
%%%>
\usepackage{textcomp}
\usetikzlibrary{shapes,arrows}
\begin{document}
% Definition of blocks:
\tikzset{%
block/.style = {draw, thick, rectangle, minimum height = 3em,
minimum width = 3em},
sum/.style = {draw, circle, node distance = 2cm}, % Adder
input/.style = {coordinate}, % Input
output/.style = {coordinate} % Output
}
% Defining string as labels of certain blocks.
\tikzset{%
block/.style = {draw, thick, rectangle, minimum height = 3em,
minimum width = 3em},
sum/.style = {draw, circle, node distance = 2cm}, % Adder
input/.style = {coordinate}, % Input
output/.style = {coordinate} % Output
}
\begin{tikzpicture}[auto, thick, node distance=2cm, >=triangle 45]
\draw
node at (0,0) [input, name=input1] {}
node [sum, right of=input1] (suma1) {}
node at (5,0) [block] (G) {$\mathbf{G}(s)$}
node at (8,0) [output,name = output1con]{}
node [block, below of=G] (K) {$\mathbf{K}(s)$}
node[sum,below of=output1con](suma2){}
node [output, right of=output1con](output1){}
node [output,below of=input1](output2){}
node [input, below of=output1](input2){}
;
% Joining blocks.
% Commands \draw with options like [->] must be written individually
\draw[->](input1) -- node[near start] {$\mathbf{u}_1(s)$}(suma1)
node[near end,below]{$+$}(suma1);
\draw[->](suma1) -- node {$\mathbf{e}_1(s)$} (G);
\draw[->](G) -- node{}(output1con) -- node[] {}(output1);
\draw[->](output1con) -- node[right,near end]{$+$}(suma2);
\draw[->](K) -| node[near end,above=4mm,left]{$+$} (suma1);
\draw[->](suma2) -- node[above]{$\mathbf{e}_2(s)$}(K);
\draw[->](K)--node[]{}(output2);
\draw[->](input2) -- node[right=3mm, above]{$\mathbf{u}_2(s)$}(suma2)
node[near end, above]{$+$}(suma2);
\end{tikzpicture}
\end{document}
答案1
使用这种方法绘制一个带有十字的圆圈并使用该minimum size
选项,这将是获得图形的一种方法:
\documentclass[tikz,14pt,border=10pt]{standalone}
%%%<
\usepackage{verbatim}
%%%>
\usepackage{textcomp}
\usetikzlibrary{shapes,arrows}
\begin{document}
% Definition of blocks:
\tikzset{%
block/.style = {draw, thick, rectangle, minimum height = 3em,
minimum width = 3em},
sum/.style = {draw, circle, node distance = 2cm}, % Adder
input/.style = {coordinate}, % Input
output/.style = {coordinate} % Output
}
% Defining string as labels of certain blocks.
\tikzset{%
block/.style = {draw, thick, rectangle, minimum height = 3em,
minimum width = 3em},
cross/.style={path picture={
\draw[black]
(path picture bounding box.south east) -- (path picture bounding box.north west) (path picture bounding box.south west) -- (path picture bounding box.north east);
}},
sum/.style = {draw, circle, cross, node distance = 2cm, minimum size = 3ex}, % Adder
input/.style = {coordinate}, % Input
output/.style = {coordinate} % Output
}
\begin{tikzpicture}[auto, thick, node distance=2cm, >=triangle 45]
\draw
node at (0,0) [input, name=input1] {}
node [sum, right of=input1] (suma1) {}
node at (5,0) [block] (G) {$\mathbf{G}(s)$}
node at (8,0) [output,name = output1con]{}
node [block, below of=G] (K) {$\mathbf{K}(s)$}
node[sum,below of=output1con](suma2){}
node [output, right of=output1con](output1){}
node [output,below of=input1](output2){}
node [input, below of=output1](input2){}
;
% Joining blocks.
% Commands \draw with options like [->] must be written individually
\draw[->](input1) -- node[near start] {$\mathbf{u}_1(s)$}(suma1)
node[near end,below]{$+$}(suma1);
\draw[->](suma1) -- node {$\mathbf{e}_1(s)$} (G);
\draw[->](G) -- node{}(output1con) -- node[] {}(output1);
\draw[->](output1con) -- node[right,near end]{$+$}(suma2);
\draw[->](K) -| node[near end,above=4mm,left]{$+$} (suma1);
\draw[->](suma2) -- node[above]{$\mathbf{e}_2(s)$}(K);
\draw[->](K)--node[]{}(output2);
\draw[->](input2) -- node[right=3mm, above]{$\mathbf{u}_2(s)$}(suma2)
node[near end, above]{$+$}(suma2);
\end{tikzpicture}
\end{document}