答案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}