![使用球坐标绘制三维曲线](https://linux22.com/image/362497/%E4%BD%BF%E7%94%A8%E7%90%83%E5%9D%90%E6%A0%87%E7%BB%98%E5%88%B6%E4%B8%89%E7%BB%B4%E6%9B%B2%E7%BA%BF.png)
其中,球面的点在球面坐标系中显示为,\theta
范围[0,2pi[
为,南北极的坐标为和。以下是我尝试在 上绘制光纤:\phi
[0,pi]
N <-> (0,0)
S <-> (pi,pi)
pi/4
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12} %no idea what this does%
\begin{document}
\begin{tikzpicture}
\begin{axis} [hide axis]
\addplot3[variable=t,mesh,domain=2*pi:5*pi/2] ({sin(deg(5*pi/(4*t)))*cos(deg(t))}, {sin(deg(5*pi/(4*t)))*sin(deg(t))}, {cos(deg(5*pi/(4*t)))});
\addplot3[variable=t,mesh,domain=5*pi/2:3*pi] ({sin(deg(5*pi/(4*(5*pi-t))))*cos(deg(t))}, {sin(deg(5*pi/(4*(5*pi-t))))*sin(deg(t))}, {cos(deg(5*pi/(4*(5*pi-t))))});
\addplot3[variable=t,mesh,domain=3*pi:7*pi/2] ({sin(deg(5*pi/(4*(t-pi))))*cos(deg(t))}, {sin(deg(5*pi/(4*(t-pi))))*sin(deg(t))}, {cos(deg(5*pi/(4*(t-pi))))});
\addplot3[variable=t,mesh,domain=7*pi/2:4*pi] ({sin(deg(5*pi/(4*(6*pi-t))))*cos(deg(t))}, {sin(deg(5*pi/(4*(6*pi-t))))*sin(deg(t))}, {cos(deg(5*pi/(4*(6*pi-t))))});
\end{axis}
\end{tikzpicture}
\end{document}
我必须改变域以\theta
避免被 0 除。结果如下
但是,我想另外绘制球体,以便人们可以看到该曲线位于球体上,但我似乎无法做到这一点。任何帮助都将不胜感激。