Note

This Mathematica notebook is from the WWW project A Visual Dictionary of Special Plane Curves. Copyright © 1995-2000 by Xah Lee. (http://xahlee.org/)

Loading Packages

Needs["RuledSurfacePlot`"]
(* MathSource Item: 0207-975 *)

Needs["ExtendGraphics`Geometry3D`"]
(* MathSource Item:0208-976 *)
(* download this package from http://www.mathsource.com/ and place the folder in the AddOns/Applications folder. *)

Clear[ Slice3DGraphics]

(*Clip3D is a function in Tom W.J.'s Package*)
(*It is not well documented. Here's a replacement usage documentation*)
Clip3D::usage= "Clip3D[ gPrim, Plane[p,v] ]
	will take a list of Graphics3D primitives gPrim, and return a list of
	Graphics3D primitives that is on one side of the plane Plane[p,v],
	where v is the normal vector and p is a point on the plane. Primitives
	that contain points on both sides are cut. Example:
	Needs[\"Graphics`Shapes`\"];
	Show@ Graphics3D@ Clip3D[ Torus[2,1,15,15], Plane[{2,0,0}, {-1,0,0}]]";

Slice3DGraphics::usage = "
	Slice3DGraphics[ graphics3DPrimitives,  sliceAxis, {p1, p2,...,pn} ]
	will return a list of Graphics3D primitives that is parts of the
	given graphics3DPrimitives sliced along planes passing through
	a list of nPoints {p1, p2,...,pn} and normal to sliceAxis vector.
	Graphics that lies outside the first and last cutting plane will
	be clipped.	The number of Graphics3D objects returned depends on
	positions of nPoints.
	The nPoints that define the slicing plane must be
	in order; towards the direction of sliceAxis vector.
	sliceAxis is a vector of the form {x,y,z}.
	Slice3DGraphics calls functions in the package ExtendGraphics`Geometry3D.";

Slice3DGraphics[ gp_List, axis_List, throughPoints_List ]:=
Module[{pieces, remain},
	remain = gp;
	pieces = Table[Null, {Length@ throughPoints-1} ];
	Do[
		remain = Clip3D[ remain, Plane[ throughPoints[[i]], axis] ];
		pieces[[i]] = Clip3D[ remain, Plane[ throughPoints[[i+1]], -axis] ],
		{i, Length@ pieces}
	];
	pieces
]

Conic Sections

This notebook contain codes that lets the user generate arbitrary double cone and cutting plane to form any conic sections.

The Intersection of a Cone and a Plane

The intersection of a plane and a right circular cone is always one of parabola, ellipse, hyperbola, or degenerate conics: a point, a line, or two non-parallel lines.

Let α be the angle between the axis of the cone and the generating lines. Let θ be the smaller angle formed by the axis of the cone and the cutting plane. Let d be the distance from the vertex of the cone to the cutting plane.
The relation of α and θ defines the type of curve. d affects the scaling or size of the curve. The magnitude of d is proportional to the size of the curve.
If θ < α, hyperbola; and if d == 0, two non-parallel lines.
If θ == α, parabola; and if d == 0, a line.
If θ > α, ellipse; and if d == 0, a point.

The following program will draw a cut double cone and its cross-section view to show the cutting and cone angles. You can change the definition of α, θ, and d to see different conics.

Clear[α,θ,d,doubleCone2DGP,cuttingPlane2DGP,v1,v2,ll,coneGP,unitV];

α=50 Degree;
θ=30 Degree;
d=2;

{α,θ,d}=N[{α,θ,d}];
v1={d Csc[α+θ] Sin[α],d Cos[α] Csc[α+θ]};
v2={d Csc[α-θ] Sin[α],-(d Cos[α] Csc[α-θ])};
ll=Which[N[α>θ],1.5 (Sqrt[v2.v2]),N[α<θ],1.2 (Sqrt[v2.v2]),True,2 (Sqrt[v1.v1])];

doubleCone2DGP={Line[{{Sin[α],Cos[α]} ll,-{Sin[α],Cos[α]} ll}],Line[{{Sin[α],-Cos[α]} ll,-{Sin[α],-Cos[α]} ll}]};
cuttingPlane2DGP=Line[{{Sin[θ],-Cos[θ]} ll+{Cos[θ],Sin[θ]} d,-{Sin[θ],-Cos[θ]} ll+{Cos[θ],Sin[θ]} d}];
unitV[v_]:=(v/(Sqrt[Plus@@(v^2)]));

coneGP=(DeleteCases[#1,_Line|{}|_Hue,-1]&)[First[RuledSurfacePlot[{{ll Sin[α] Cos[t],ll Sin[α] Sin[t],ll Cos[α]},{ll Sin[α] Cos[t+π],ll Sin[α] Sin[t+π],-ll Cos[α]}},{t,0,2 π},PlotPoints->{25,3},CheckerBoardPattern->False,DisplayFunction->Identity]]];

coneGP=Slice3DGraphics[coneGP,N[{Cos[θ],0,Sin[θ]}],N[Table[unitV[{Cos[θ],0,Sin[θ]}] i,{i,-ll,d,ll+d}]]];

coneGP=FixedPoint[DeleteCases[#1,{},{-2}]&,coneGP,10];

Show[Graphics[{{Hue[.65],Disk[{0,0},.07 ll,{(π/2)-α,(π/2)}],Hue[.65],Disk[{0,(d/(Sin[θ]))},.07 ll,{(π/2),(π/2)+θ}]},{Hue[0,0,0],Thickness[.007],doubleCone2DGP},{Hue[.3,1,.5],Thickness[.007],cuttingPlane2DGP},{Hue[0],Line[{{0,-ll},{0,ll}}]},{Hue[.65],Text["α",{0,0},{-2,1}],Hue[.65],Text["θ",{0,(d/(Sin[θ]))},{-2,0}]}}],PlotRange->{{-1,1} ll Sin[α],{-1,1} ll Cos[α]} 1.1,Axes->False,AspectRatio->Automatic,PlotLabel->Which[N[d==0.],"degenerate conics",N[α>θ],"hyperbola cut",N[α<θ],"ellipse cut",True,"parabola cut"]];

Show[Graphics3D[{coneGP}],ViewPoint->{1.063,-3.040,1.040},Boxed->False];

RuledSurfacePlot[{RotateSpaceCurve[{ll Sin[α] Cos[#1],ll Sin[α] Sin[#1],ll Cos[α]}&,0,(π/2)-θ,0][t],RotateSpaceCurve[{ll Sin[α] Cos[#1+π],ll Sin[α] Sin[#1+π],-ll Cos[α]}&,0,(π/2)-θ,0][t]},{t,0,2 π},PlotPoints->{26,7},CheckerBoardPattern->False,PlotRange->{-ll+(d/2),d},ViewPoint->{1.300,-2.400,2.000},ViewCenter->{.5,.5,.5},ViewVertical->{0,0,1}];