我本以为这会很简单,但我仍然没有找到一种简单的方法。我只想画一个圆锥、一个平面和它们的交点(这将是一个圆锥截面)。类似于,例如:
http://mathworld.wolfram.com/ConicSection.html
或者这里的图片:
http://www.ck12.org/book/CK-12-Algebra-II-with-Trigonometry-Concepts/section/10.0/
这些标准图片我们之前已经看过无数次了。
我并不介意使用 LaTeX 绘图包或其他东西,但我想自己做,这样我就可以尝试使用圆锥和平面来获得最佳图表。我尝试了一些在线工具,例如 3dtin 和 shapesmith,但它们有点不稳定。使用矢量绘图包然后将结果导出到 LaTeX 会很好,但在这个阶段我会使用图像。它也可以是黑白线图,而不是表面图。
以前有人创建过类似的东西吗?
答案1
pst-solides3d
似乎是个不错的选择。在 PS-Tricksgallery of 3D examples
Manuel Luque 给出了一个很好的起点:
\documentclass{article}% Manuel Luque
\usepackage{pst-solides3d}
\def\bicone{% generation du bicone
/dZ 0.5 def
/Rayon 3 def % rayon de la base
/Hauteur 3 def % hauteur d'un cone
/THETA Rayon Hauteur atan def
/tanTHETA {Rayon Hauteur div} bind def
/dPHI 10 def
/tableau_des_sommets [
Hauteur neg dZ Hauteur dZ sub{/Z exch def
0 dPHI 360 {/PHI exch def
/r1 Z abs tanTHETA mul def
/r2 Z dZ add abs tanTHETA mul def
r1 PHI cos mul % x0
r1 PHI sin mul % y0
Z % z0
r1 PHI dPHI add cos mul % x1
r1 PHI dPHI add sin mul % y1
Z % z1
r2 PHI dPHI add cos mul % x2
r2 PHI dPHI add sin mul % y2
Z dZ add % z2
r2 PHI cos mul % x3
r2 PHI sin mul % y3
Z dZ add % z3
} for
} for
]
def
/Sommets {tableau_des_sommets aload pop} def
/NbrePoints tableau_des_sommets length 3 div cvi def
/Faces {0 4 NbrePoints 4 sub {
/Ni exch def
[ Ni Ni 1 add Ni 2 add Ni 3 add]
} for
} def
/Faces_internes {0 4 NbrePoints 4 sub {
/Ni exch def
[Ni 3 add Ni 2 add Ni 1 add Ni]
} for
} def
}
\begin{document}
\begin{center}
\psset{unit=0.7}
\psset{lightsrc=viewpoint}
\psset{viewpoint=100 30 20 rtp2xyz,Decran=100}
\begin{pspicture}(-3,-5)(3,5)
\pstVerb{\bicone}%
\psSolid[object=new,sommets=Sommets,faces={Faces},
hollow,
incolor=yellow!25,
intersectiontype=0,
intersectionlinewidth=2,
intersectioncolor=(rouge),
intersectionplan={[0 0.5 1 1]}]
\axesIIID[linecolor=blue](0,0,3)(8.5,4.5,4)
\end{pspicture}
\begin{pspicture}(-5,-5)(5,5)
\pstVerb{\bicone}%
\psset{solidmemory}
\psSolid[object=new,sommets=Sommets,faces={Faces},
hollow,
plansepare={[0 0.5 1 1]},
name=partbicone,
action=none]
\psSolid[object=load,
hollow,rm=0,
incolor=yellow!25,
load=partbicone1,
intersectiontype=0,
intersectionlinewidth=2,
intersectioncolor=(rouge),
intersectionplan={[0 0.5 1 1.01]}]
\psSolid[object=plan,definition=equation,
args={[0 0.5 1 1] 180},
base=-3 3 -3 3,linewidth=0.01,
planmarks,showBase,
action=draw]
\psSolid[object=load,
incolor=yellow!25,
load=partbicone0](0,4,0)
\axesIIID[linecolor=blue](0,0,0)(8.5,4.5,4)
\end{pspicture}
\end{center}
\end{document}
生成的图像(直接取自 PSTricks 主页):
答案2
同样,稍微简单一点:
\documentclass[landscape]{article}
\usepackage{geometry}
\usepackage{pst-solides3d}
\begin{document}
\psset{unit=0.7,lightsrc=viewpoint,viewpoint=100 30 20 rtp2xyz,Decran=100}
\begin{pspicture}(-5,-5)(5,5)
\psSolid[object=cone,h=3,r=3,ngrid=5 30,intersectiontype=0,
intersectionlinewidth=2,intersectioncolor=(red),
intersectionplan={[0 0.5 1 1]}](0,0,-3)
\psSolid[object=conecreux,h=3,r=3,ngrid=5 30,RotX=180](0,0,3)
\axesIIID[linecolor=blue](0,0,3)(8.5,4.5,5)
\end{pspicture}
%
\begin{pspicture}[solidmemory](-4,-5)(7,5)
\psSolid[object=cone,h=3,r=3,ngrid=5 30,plansepare={[0 0.5 1 1]},
name=partbicone,action=none](0,0,-3)
\psSolid[object=load,hollow,rm=0,incolor=yellow!25,
load=partbicone1,intersectiontype=0,intersectionlinewidth=2,
intersectioncolor=(red),intersectionplan={[0 0.5 1 1.01]}]
\psSolid[object=plan,definition=equation,args={[0 0.5 1 1] 180},
base=-3 3 -3 3,linewidth=0.01,planmarks,showBase,action=draw]
\psSolid[object=load,incolor=yellow!25,load=partbicone0](0,4,0)
\psSolid[object=conecreux,h=3,r=3,ngrid=5 30,RotX=180](0,4,3)
\axesIIID[linecolor=blue](0,0,3)(8.5,4.5,5)
\end{pspicture}
\end{document}