Previous Page Next Page Contents

plot::implicit -- implicit plot of smooth functions

Introduction

plot::implicit is used to get a plot of f=0 for a smooth f from |R^2->|R. f must be regular almost everywhere on this curve.

Call(s)

plot::implicit(expr, x=a..b, y=c..d <, options>)
plot::implicit([expr, ...], x=a..b, y=c..d <, options>)

Parameters

expr - function(s) to plot, given as arithmetical expression(s) in two identifiers
x, y - identifiers used in expr
a..b, c..d - ranges to plot

Options

Grid = gridval - grid division to use for finding starting points
Colors = [col1...] - colors used for plotting the components.
MinStepsize = hmin - minimum step-size for tracing a contour
MaxStepsize = hmax - maximum step-size for tracing a contour
StartingStepsize = hstart - step-size the iteration starts with
Precision = eps - precision of the Newton iteration
Contours = [c1...] - contours to plot
Splines = Boolean - If set to TRUE, the contours will be plotted with cubic splines; otherwise, straight lines will be used. Default: FALSE.
Factor = Boolean - If set to TRUE, each function will be factored prior to iterating. This may improve the results. Default: FALSE.

Returns

a graphical object of the domain type plot::Group.

Related Functions

plot::contour, plotfunc2d, plot2d

Details

Option: Grid = gridval

Option: Colors = [col1...]

Option: MinStepsize = hmin

Option: MaxStepsize = hmax

Option: StartingStepsize = hstart

Option: Precision = eps

Option: Contours = [c1...]

Example 1

Let's have a look at elliptic curves:

>> plot(
     plot::implicit((x^3 + x + 2) - y^2,
                    x = -5..5, y = -5..5),
     Scaling=Constrained
   )
    

Example 2

To demonstrate how to plot multiple implicit functions, we plot y=x^2, y=x and x=y^2:

>> s:= plot::implicit(
     [x^2 - y, x - y, x - y^2], x = -4..4, y = -4..4
   ):
   plot(s)
    

Example 3

We plot the family x=y^2+c for c in [-5,5]:

>> p:= plot::implicit(
     y^2 - x, x = -1..25, y = -5..5, Contours = [$-5..5]
   ):
   plot(p, Axes = Origin)
    

Example 4

plot::implicit handles quite complex expressions. In the following example, the circle around the origin is left out by many similar tools:

>> plot(
     plot::implicit((1-0.99*exp(x^2+y^2))*(x^10-1-y),
                    x=-1.25..1.25,y=-1.1..2)
   ):
>> F2 := (x,y) -> x^4*y^4+sin(x)*cos(y)-(x-1)*(y-2)*exp(-x^2):
   plot(plot::implicit(F2(x,y),x=-10..10,y=-10..10)):
>> delete F2:

Example 5

In some cases, DIGITS must be increased to get a correct result. In the following example, problems occur around the origin with the default setting of DIGITS when a small region is to be displayed. First, we display the whole picture:

>> F3 := (x,y) -> y*(3*x^2-y^2)-(x^2+y^2)^2:
   plot(plot::implicit(F3(x, y), x = -1..1, y = -1.3..0.7)):

Near the origin, numeric cancellation occurs. If you try to depict a small area around the origin of the above curve, you need to increase DIGITS:

>> delete DIGITS:
   plot(
     plot::implicit(F3(x, y), x = -0.005..0.005, y = -0.005..0.005)
   ):
>> DIGITS := 15:
   plot(
     plot::implicit(F3(x, y), x = -0.005..0.005, y = -0.005..0.005)
   ):
   delete DIGITS:

Example 6

We plot sin(5*sin(x)*y)=0. This is an example where multiple implicit functions are found. With a low setting of DIGITS, strange artefacts occur:

>> DIGITS := 50:
   plot(
     plot::implicit(sin(5*sin(x)*y), x = -5..5, y = -5..5)
   ):
   delete DIGITS:
    

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000