Function Repository Resource:

# ConicSectionPlot

Classifies and plots any polynomial of degree two or less in two or fewer variables

Contributed by: Dennis M Schneider and Robby S Villegas
 ResourceFunction["ConicSectionPlot"][poly,vars] plots the conic section specified by the expression poly=0 as a function of the variables vars. ResourceFunction["ConicSectionPlot"][poly1⩵poly2,vars] returns ResourceFunction["ConicSectionPlot"][poly1-poly2,vars]. ResourceFunction["ConicSectionPlot"][poly,vars,"ReturnData"] returns the data used to produce the plot, wrapped in Inactive.

## Details and Options

The expression poly should be a polynomial of degree two or less, in two or fewer variables. The argument vars specifies the variables in poly, and must have length two.
With "ReturnData", the user has access to all the data used to produce the plot which allows the user make any desired modifications. Use Activate to restore the plot.
Styles for degenerate conics (a single point, a single line, two lines parallel or not) are set with the option "PrimitivesStyle".
ResourceFunction["ConicSectionPlot"] uses the resource function DiagonalizeQuadratic to compute the canonical form of a quadratic. Using the canonical form, it generates parametric equations of the curve.
The option "DrawAxes" allows for the principal axes to be included in the plot. The axes are color coded so that the axes colors Red and Green define a right-handed system. Other options are those of ParametricPlot.

## Examples

### Basic Examples (4)

Plot a hyperbola:

 In:= Out= Plot a rotated and translated hyperbola and show the axes:

 In:= Out= Plot a rotated and translated parabola and show the axes:

 In:= Out= Plot an ellipse:

 In:= Out= ### Scope (10)

Plot a rotated and translated ellipse, with a style set for the ellipse, and show the axes:

 In:= Out= Use "ReturnData" to examine and possibly modify the data used to produce the plot and possibly modify the data:

 In:= Out= Make several changes to the data (shrink the arrowheads, enlarge the center point, and enlarge the plot range) and plot the result:

 In:= Out= Compare with the original plot:

 In:= Out= Plot a pair of intersecting lines:

 In:= Out= These lines intersect because the polynomial can be expressed as a difference of squares. Confirm with the resource function CompleteTheSquare:

 In:= Out= Plot a pair of parallel lines:

 In:= Out= Change the style of the two lines using the option "PrimitivesStyle":

 In:= Out= Plot an oblique line:

 In:= Out= Plot a pair of parallel oblique lines and show the axes:

 In:= Out= Plot a line parallel to a coordinate axis:

 In:= Out= This equation determines the whole plane:

 In:= Out= This equation determines the empty set:

 In:= Out= This equation determines the origin:

 In:= Out= This equation determines point {1,1/2}:

 In:= Out= ### Possible Issues (4)

ConicSectionPlot will returned \$Failed if the degree of the quadratic is more than 2:

 In:=  Out= ConicSectionPlot will returned \$Failed if the expression is not a polynomial:

 In:=  Out= ConicSectionPlot will returned \$Failed if if there is not the correct number of input variables:

 In:=  Out= ConicSectionPlot will returned \$Failed if the input expression is not a polynomial in the specified variables:

 In:=  Out= ## Publisher

Dennis M Schneider

## Version History

• 1.0.0 – 08 October 2019