你好!我想知道如何添加一个圆圈 (x-1.5)^2+(y-1.5)^2=1.5^2,如红色所示。这是我的代码:
\documentclass{article}
\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{gensymb}
\usetikzlibrary{shapes,arrows,positioning}
\pgfplotsset{compat=1.18, width=10cm}
\begin{document}
\begin{center}
\tdplotsetmaincoords{60}{125}
\begin{tikzpicture}
[tdplot_main_coords,
cube/.style={very thick,black},
axis/.style={->,blue,thick}]
%draw the axes
\draw[axis] (0,0,0) -- (4,0,0) node[anchor=west]{$x$};
\draw[axis] (0,0,0) -- (0,4,0) node[anchor=west]{$y$};
\draw[axis] (0,0,0) -- (0,0,4) node[anchor=west]{$z$};
%draw the top and bottom of the cube
\draw[cube] (0,0,0) -- (0,3,0) -- (3,3,0) -- (3,0,0) -- cycle;
\draw[cube] (0,0,3) -- (0,3,3) -- (3,3,3) -- (3,0,3) -- cycle;
%draw the edges of the cube
\draw[cube] (0,0,0) -- (0,0,3);
\draw[cube] (0,3,0) -- (0,3,3);
\draw[cube] (3,0,0) -- (3,0,3);
\draw[cube] (3,3,0) -- (3,3,3);
\end{tikzpicture}
\end{center}
\end{document}
答案1
添加以下代码行
\draw[thick, red] (1.5, 1.5, 0) circle (1.5);
平均能量损失
\documentclass{article}
\usepackage{pgfplots}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{gensymb}
\usetikzlibrary{shapes,arrows,positioning}
\pgfplotsset{compat=1.18, width=10cm}
\begin{document}
\begin{center}
\tdplotsetmaincoords{60}{125}
\begin{tikzpicture}
[tdplot_main_coords,
cube/.style={very thick,black},
axis/.style={->,blue,thick}]
%the circle
\draw[thick, red] (1.5, 1.5, 0) circle (1.5);
%draw the axes
\draw[axis] (0,0,0) -- (4,0,0) node[anchor=west]{$x$};
\draw[axis] (0,0,0) -- (0,4,0) node[anchor=west]{$y$};
\draw[axis] (0,0,0) -- (0,0,4) node[anchor=west]{$z$};
%draw the top and bottom of the cube
\draw[cube] (0,0,0) -- (0,3,0) -- (3,3,0) -- (3,0,0) -- cycle;
\draw[cube] (0,0,3) -- (0,3,3) -- (3,3,3) -- (3,0,3) -- cycle;
%draw the edges of the cube
\draw[cube] (0,0,0) -- (0,0,3);
\draw[cube] (0,3,0) -- (0,3,3);
\draw[cube] (3,0,0) -- (3,0,3);
\draw[cube] (3,3,0) -- (3,3,3);
\end{tikzpicture}
\end{center}
\end{document}
输出