Function Repository Resource:

Classify and plot any polynomial of degree two or less in three or fewer variables

Contributed by: Dennis M Schneider and Robby S Villegas
 ResourceFunction["QuadricSurfacePlot"][poly,vars] plots the quadric surface specified by poly=0 as a function of the variables vars. ResourceFunction["QuadricSurfacePlot"][poly1⩵poly2,vars] returns ResourceFunction["QuadricSurfacePlot"][poly1-poly2,vars]. ResourceFunction["QuadricSurfacePlot"][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 three or fewer variables. The argument vars specifies the variables in poly, and must have length three.
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 point, a set of lines, or a polygon) are set with the option "PrimitivesStyle".
ResourceFunction["QuadricSurfacePlot"] uses ResourceFunction["DiagonalizeQuadratic"] to compute the canonical form of a quadratic. Using the canonical form it generates parametric equations of the surface. The option "DrawAxes" allows for the principal axes to be included with the plot. The axes are color coded so that axes colors Red, Green, Blue determine a right handed system. Other options are those of ParametricPlot3D.

## Examples

### Basic Examples (19)

Plot an ellipsoid:

 In:= Out= Plot an ellipsoid whose graph requires a rotation:

 In:= Out= Plot a hyperboloid of one sheet:

 In:= Out= Plot a hyperboloid of one sheet whose equation contains a mixed term:

 In:= Out= Plot a hyperboloid of two sheets whose graph requires a rotation and translation:

 In:= Out= Plot a hyperbolic paraboloid:

 In:= Out= Plot a hyperbolic paraboloid requiring a rotation and translation:

 In:= Out= Plot an elliptical paraboloid requiring a rotation and translation:

 In:= Out= Plot an oblique parabolic cylinder:

 In:= Out= Plot a hyperbolic cylinder:

 In:= Out= Plot a vertical plane:

 In:= Out= Plot an oblique plane:

 In:= Out= Plot a plane perpendicular to the z-axis:

 In:= Out= Plot two intersecting planes:

 In:= Out= Plot two parallel planes:

 In:= Out= Since the only solution to the equation x2+2xy+4y2=0 is x=0 and y=0, the quadric surface determined by this equation is the z-axis:

 In:= Out= Plot the origin:

 In:= Out= Plot an equation that is always satisfied:

 In:= Out= Plot an equation that is never satisfied:

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

Use "ReturnData" to examine the data used to produce the plot and possibly modify the data. Plot a cone requiring a rotation and translation:

 In:= Out= Examine the data:

 In:= Out= Make several changes to the data, and plot the result (enlarge the arrowheads, make the shafts longer, and change the ranges used to produce the plot):

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

QuadricSurfacePlot will returned \$Failed if the degree of the quadric is more than 2:

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

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

 In:=  Out= QuadricSurfacePlot 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 – 04 October 2019