答案1
pstricks 包中pst-3dplot
有一个\parametricplotThreeD
用于空间曲线的命令。下面是 Viviani 曲线(球体与球体相切且通过球体中心的圆柱体的交点)的示例:
\documentclass[svgnames, border=6pt]{standalone}
\usepackage[T1]{fontenc}
\usepackage{pst-3dplot, pst-math}
\def\R{4}
\begin{document}
\psset{xPlotpoints = 500, plotstyle=curve, algebraic, arrowinset=0.2, labelsep=3pt}
\begin{pspicture}(-4.5,-4)(3.5,4.5)
\psset{linewidth=0.6pt}
\pstThreeDCoor[zMax=5, yMax=4, xMax=5.5, linecolor=LightSteelBlue]
\pstThreeDDot(0,0,0)
\psset{linewidth=1.5pt, linecolor=Coral}
\parametricplotThreeD(-\pstPI2, \pstPI2){\R*(cos(t))^2|\R*sin(2*t)/2|\R*sin(t)}
\psset{border=1pt}
\parametricplotThreeD(-\pstPI1, -\pstPI2){\R*(cos(t))^2|\R*sin(2*t)/2|\R*sin(t)}
\parametricplotThreeD(\pstPI2,\pstPI1){\R*(cos(t))^2|\R*sin(2*t)/2|\R*sin(t)}
\pstThreeDLine[linecolor=LightSteelBlue, linewidth=0.8pt](0,0,3)(0,0,4.5)
\end{pspicture}
\end{document}