Conic Section

Author

Eric W. Weisstein
August 3, 2004

This notebook downloaded from http://mathworld.wolfram.com/notebooks/PlaneGeometry/ConicSection.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/ConicSection.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Graphics`

conic[{x_,y_},{p_,e_}]:=(1-e^2)x^2-2p x+p^2+y^2
conic[x_,{p_,e_}]:=y2[{x,0},{p,e}]

Derivation

Collect[conic[{x,y},{p,e}],x]

CompleteSquare[conic[x,{p,e}],x]

FullSimplify[conic[x,{a,e}]-CompleteSquare[conic[x,{a,e}],x]]

Focal Parameters

Circle

Simplify[conic[{x,y},{p,0}]]

ImplicitPlot[conic[{x,y},{p,0}]==1/. {p->1},{x,-5,5}]

Ellipse

Focal parameter

PowerExpand[Together//@(a(1-e^2)/e /. e->Sqrt[1-b^2/a^2])]

conic[{x,y},{a/e(1-e^2),e}]

ImplicitPlot[conic[{x,y},{a e,e}]==0/. {a->.5,e->.5},{x,-5,5}]

Parabola

Simplify[conic[{x,y},{2p,1}]]

ImplicitPlot[conic[{x,y},{2a,1}]==0/. {a->.5},{x,-5,5}]

Hyperbola

Focal parameter

PowerExpand[Together//@(a(e^2-1)/e /. e->Sqrt[1+b^2/a^2])]

conic[{x,y},{p e,e}]

conic[{x,y},{a(e^2-1)/e,e}]

ImplicitPlot[conic[{x,y},{a(e^2-1)/e,e}]==0/. {a->1,e->2},{x,-6,5}]

5-Point Form

<<Graphics`

f[{x_,y_},{b_,c_,d_,f_,g_}]:=x^2+2b x y+c y^2+d x +f y+g==0

conic[pts_,{x_,y_}]:=f[{x,y},coniccoefs[pts,{x,y}]]

coniccoefs[pts_,{x_,y_}]:={b,c,d,f,g}/.Solve[f[#,{b,c,d,f,g}]&/@pts,{b,c,d,e,f,g}][[1]]

Transpose[{Array[x,5],Array[y,5]}]

soln=coniccoefs[Transpose[{Array[x,5],Array[y,5]}],{x,y}]

Simplify[%]

Show[GraphicsArray[
Table[
ImplicitPlot[conic[pts=Table[Random[],{5},{2}],{x,y}],{x,-1.5,1.5},{y,-1.5,1.5},DisplayFunction->Identity,Epilog->{PointSize[.05],Point/@pts}],{3}]]]

Conic[m_List,{x_,y_}]:=Det[Prepend[{#1^2,#1 #2,#2^2,#1,#2,1}&@@@m,{x^2,x y,y^2,x,y,1}]]/;Dimensions[m]=={5,2}

pts1=Table[Random[],{5},{2}]

pts2=Table[Random[],{5},{2}]

pts3=Table[Random[],{5},{2}]

<<Graphics`ImplicitPlot`
<<Graphics`Colors`

Show[GraphicsArray[
Block[{$DisplayFunction=Identity},ImplicitPlot[Conic[#,{x,y}]==0,{x,-2,2},Epilog->{Red,PointSize[.03],Point/@#}]&/@{pts1,pts2,pts3}
]
]]

Conic-conic intersection

Solve[{a1 x^2+2b1 x y+c1 y^2+2d1 x+2f1 y+g1==0,
a2 x^2+2b2 x y+c2 y^2+2d2 x+2f2 y+g2==0},{x,y}]//Timing