%20%E4%B8%AD%E5%9C%A8%E5%9C%86%E5%9C%88%E5%86%85%E7%94%BB%E4%B8%80%E4%B8%AA%E6%AD%A3%E6%96%B9%E5%BD%A2%EF%BC%9F.png)
答案1
还有一个有趣的:使用backgrounds
和fit
库。
\documentclass[border=3.141592mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds,
fit}
\begin{document}
\begin{tikzpicture}[
base/.style args = {#1/#2}{draw=#1, very thick, fill=#2}
]
\node [base=blue/white, minimum size=2cm, rotate=45] (t) {};
\scoped[on background layer]
\node[base=yellow/yellow, circle, inner sep=0.5\pgflinewidth,
fit=(t.north west) (t.south east)] {};
\end{tikzpicture}
\end{document}
答案2
只是为了好玩:
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[dashed, red, ultra thick] node[draw, circle, minimum width=2cm, rotate=30] (A){};
\draw (A.north east) -- (A.south east) -- (A.south west) -- (A.north west) -- cycle;
\end{tikzpicture}
\end{document}