我想知道是否可以绘制以下三个二次曲面(圆锥体,双曲面)
x^2+y^2-z^2=0
x^2+y^2-z^2=1
x^2+y^2-z^2=-1
(and the axis)
使用pgfplots
3d
或 TikZ,如下图所示
答案1
运行它xelatex
\documentclass{article}
\usepackage{pst-solides3d}
\begin{document}
\psset{unit=0.8,viewpoint=50 60 30 rtp2xyz,Decran=50,lightsrc=viewpoint,
ngrid=20 20, incolor=red!30, fillcolor=blue!30}
\begin{pspicture}(-4,-4)(4,4)
\defFunction[algebraic]{f1}(u,v){u*cos(v)}{u*sin(v)}{u}
\defFunction[algebraic]{f3}(u,v){u*cos(v)}{u*sin(v)}{sqrt(u^2+1)}
\defFunction[algebraic]{f4}(u,v){u*cos(v)}{u*sin(v)}{-sqrt(u^2+1)}
\defFunction[algebraic]{f5}(u,v){u*cos(v)}{u*sin(v)}{sqrt(u^2-1)}
\defFunction[algebraic]{f6}(u,v){u*cos(v)}{u*sin(v)}{-sqrt(u^2-1)}
\psSolid[object=surfaceparametree,base=-4 4 pi pi neg,function=f1]
\psSolid[object=surfaceparametree,function=f4,base=-1 4 pi pi neg,opacity=0.4]
\psSolid[object=surfaceparametree,function=f3,opacity=0.4]
\psSolid[object=surfaceparametree,function=f6,base=1 4 pi pi neg,
fillcolor=red!30,incolor=blue!30,opacity=0.2]
\psSolid[object=surfaceparametree,function=f5,base=1 4 pi pi neg,opacity=0.2]
\gridIIID[Zmin=-4,Zmax=4](-4,4)(-4,4)
\end{pspicture}
\end{document}
或者viewpoint=50 60 10 rtp2xyz
: