# Sketching conic sections as intersections of cone and plane?

I would have thought this would be trivial, but I still haven't found an easy method. All I want to do is draw a cone, a plane, and their intersection (which will be a conic section). Something similar to, for example:

http://mathworld.wolfram.com/ConicSection.html

or the picture here:

http://www.ck12.org/book/CK-12-Algebra-II-with-Trigonometry-Concepts/section/10.0/

The same sort of standard pictures we've all seen a million times before.

I don't mind if I use a LaTeX drawing package, or something else, but I want to do it myself, so I can play around with the cone and plane to get the best possible diagram. I've tried a few online things such as 3dtin and shapesmith, but they're a bit flaky. It would be nice to use a vector drawing package and then export the result into LaTeX, but at this stage I'll settle for an image. It can also be a black and white wire diagram rather than a surface plot.

Has anybody created something like this before?

• This should give you an idea of what is possible with tikz: texample.net/tikz/examples/dandelin-spheres but it might be easier with asymptote (I don't know asymptote though). If the question is about external graphics creation programs, IMO the question is off-topic for TeX.SE. – Paul Gessler Jul 24 '14 at 14:10
• I was a bit unsure if this was on-topic or not, and I assumed a moderator would correct me if it wasn't. On the other hand, I am hoping for a vector graphics solution which I can slip into a LaTeX document. Asymptote would probably work very well, but right now I have not the time to learn the ins and outs of a new language – Alasdair Jul 25 '14 at 6:21

pst-solides3d seems a good option here. In the PS-Tricks gallery of 3D examples you have a nice starting point by 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
r2 PHI cos mul % x3
r2 PHI sin mul % y3
} for
} for
]
def
/NbrePoints tableau_des_sommets length 3 div cvi def
/Faces  {0 4 NbrePoints 4 sub {
/Ni exch def
} for
} def
/Faces_internes {0 4 NbrePoints 4 sub {
/Ni exch def
} 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]
hollow,rm=0,
incolor=yellow!25,
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]
incolor=yellow!25,
\axesIIID[linecolor=blue](0,0,0)(8.5,4.5,4)
\end{pspicture}
\end{center}
\end{document}


The resulting image (taken directly from the PSTricks homepage):

The same a bit easier:

\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)