![我怎样才能沿着平面添加一个圆圈?](https://linux22.com/image/468622/%E6%88%91%E6%80%8E%E6%A0%B7%E6%89%8D%E8%83%BD%E6%B2%BF%E7%9D%80%E5%B9%B3%E9%9D%A2%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%9C%86%E5%9C%88%EF%BC%9F.png)
你好!我想知道如何添加一个圆圈 (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}
输出