答案1
我不会使用任何 3D 工具pgfplots
,但只需使用普通的 Ti 绘制即可钾为了简单起见,Z 使用极坐标:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\tikzset{
point/.style={
fill,
circle,
inner sep=1pt
}
}
\newcommand*\diff{\mathop{}\!\mathrm{d}}
\begin{document}
\begin{tikzpicture}[
x={(1cm,0cm)},
y={(0cm,0.5cm)},
font=\scriptsize,
>=stealth,
pin distance=0.25cm,
pin position=240,
every pin edge/.style={
very thin,
bend right
},
every pin/.append style={
align=center,
inner sep=2pt
}
]
\draw[->] (0:0) -- (90:4.5) node[right] {$z$};
\draw[->] (0:0) -- (240:4.5) node[below right] {$y$};
\draw[->] (0:0) -- (0:4.5) node[below] {$x$};
\node[point, label={right:$P$}] at (90:3.5) {};
\pgfmathsetmacro{\rmeta}{3};
\draw (0:0) ellipse[radius=\rmeta];
\draw[->] (0:0) -- (30:\rmeta) node[midway, above] {$R$};
\pgfmathsetmacro{\alpha}{-35};
\pgfmathsetmacro{\beta}{-65};
\pgfmathsetmacro{\rinner}{1};
\pgfmathsetmacro{\router}{2};
\draw (0:0) -- (\alpha:\rinner);
\draw (0:0) -- (\beta:\rinner);
\draw
(\beta:0.5)
arc[start angle=\beta, end angle=\alpha, radius=0.5];
\coordinate[pin={$\varphi$}]
(a) at ({(\alpha+\beta)/2}:{0.33});
\draw[thick, fill=red!50]
(\beta:\rinner)
arc[start angle=\beta, end angle=\alpha, radius=\rinner]
-- (\alpha:\router)
arc[start angle=\alpha, end angle=\beta, radius=\router]
-- cycle;
\coordinate[pin={$\diff A =$ \\ $r \cdot \diff y \cdot \diff\varphi$}]
(c) at ({(\alpha+\beta)/2}:{(\rinner+\router)/2});
\draw[<->, shift={(0.15,0.15)}]
(\alpha:\rinner) -- ([]\alpha:\router)
node[pos=0.75, above] {$\diff r$};
\draw[<->]
([shift={(\alpha:0.15)}]\alpha:\router)
arc[start angle=\alpha, end angle=\beta, radius={\router+0.15}]
node[pos=0.25, below] {$r \cdot \diff y$};
\end{tikzpicture}
\end{document}
答案2
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
title={Disc with Sector and Point P},
axis lines = center,
xlabel = {$x$},
ylabel = {$y$},
zlabel = {$z$},
ticks=none,
xmin=-1.5, xmax=1.5,
ymin=-1.5, ymax=1.5,
zmin=0, zmax=2,
view={120}{25}
]
% Draw the blue outline of the disc
\addplot3[
samples=50,
domain=0:360,
color=blue,
variable=\t,
]
({cos(t)}, {sin(t)}, {0});
% Draw a sector in the disc
\addplot3[
surf,
domain=35:55, % Adjust the angle for the desired sector size
y domain=0:0.8, % Slightly less than the disc radius
samples=30,
opacity=0.5, % Semi-transparent for visibility
]
({y*cos(x)}, {y*sin(x)}, {0});
% Draw the point P and label it
\addplot3[mark=*, mark options={color=red}] coordinates {(0,0,1.5)};
\node at (axis cs:0,0,1.7) {$P$};
\end{axis}
\end{tikzpicture}
\end{document}