Implicit graphs

I. Cnop
icnop@vub.ac.be

Load package:

<< Graphics`PlotField`

It allows visual rendering of an implicit relationship between  x   and  y  (and its tangent elements) , 

expression(x,y) = constant 

These are called level curves or contours of the expression.

Example: Descartes' folium

Level curves

ContourPlot[x^3  +   y^3 - 9  x y,{x, -5, 5},{y, -5, 5}
,Contours -> {-6, -3, 0, 3, 6, 9, 12}
	,PlotPoints -> 25
	,ColorFunction -> Hue]

Tangent elements to   expression(x,y) = constant

These are given by

PlotHamiltonianField[x^3  +   y^3 - 9  x y,
            {x, -5, 5},{y, -5, 5}
,PlotPoints -> 25,HeadWidth -> 0.2]

Magnify this to see the arrows. If these are not wanted, use

PlotHamiltonianField[x^3  +   y^3 - 9  x y,
            {x, -5, 5},{y, -5, 5}
,PlotPoints -> 25,HeadWidth -> 0. ]

Circles

Tangent elements to circles

PlotHamiltonianField[x^2  +   y^2,
            {x, -5, 5},{y, -5, 5}
,PlotPoints -> 25,HeadWidth -> 0.3]

Parabolas

Level curves

ContourPlot[x -   y^2,{x, -5, 5},{y, -3, 3}
,Contours -> {-6, -4, -2, -1, 0, 1, 2, 4, 6}
	,PlotPoints -> 25
	,AspectRatio -> Automatic
	,ColorFunction -> Hue]

Tangent elements to parabolas

PlotHamiltonianField[x -   y^2,
            {x, -5, 5},{y, -3, 3}
,PlotPoints -> 25
		,AspectRatio -> Automatic
	,HeadWidth -> 0. ]

Animation

An animation over the two graph creates a superposition of the direction field over the level curve plot.

Non polynomial functions

Level curves

ContourPlot[2 y -  x^2 - Sin[y],{x, -5, 5},{y, -5, 5}
,Contours -> {-12, -6, -4, -2, -1, 0, 1, 2, 
            4, 6}
	,PlotPoints -> 25
	,AspectRatio -> Automatic
	,ColorFunction -> Hue]

Tangent elements to other expressions

PlotHamiltonianField[2 y -  x^2 - Sin[y],
            {x, -5, 5},{y, -5, 5}
,PlotPoints -> 25
		,AspectRatio -> Automatic
	,HeadWidth -> 0. ]

Magnify these to have a better view.

Epilogue: Modern  Art

Level curves

ContourPlot[ y - Sin[x y],{x, -8, 8},{y, -8, 8}
,Contours -> {-12, -6, -4, -2, -1, 0, 1, 2, 
            4, 6}
	,PlotPoints -> 241
	,AspectRatio -> Automatic
	,ColorFunction -> Hue]

Experiment

You can decorate your room by such large format prints.

ContourPlot[ Cos[x - y] - Sin[x y],{x, -8, 8},{y, -8, 8}
,Contours -> {-1.2, - .8, - .4, - .2, - .1, 
            0,  .1,  .2,  .4,  .6,  .8, 1. }
	,PlotPoints -> 241
	,AspectRatio -> Automatic
	,ColorFunction -> Hue]