## `plot::inequality` -- generate a 2D plot of inequalities

#### Introduction

`plot::inequality``([f1, f2,...], left..right, bottom..top)` serves for displaying points (x,y) in the rectangle Q=[left,right] x [bottom, top] satisfying the inequalities

    f1(x,y)>=0 and f2(x,y)>=0 and ..

#### Call(s)

`plot::inequality([f1, f2...], left..right, bottom..top <, n> <Colors = [c1, c2, c3]>)`

#### Parameters

`f1, f2...` | - | real valued functions of two variables: procedures
`left, right, bottom, top` | - | real numerical values
`n` | - | a nonnegative integer determining the mesh size. The default value is 6.

#### Options

`Colors = [c1, c2, c3]` | - | each of the colors `c1`, `c2`, `c3` must be an RGB specification, i.e., a list of three real numerical values between 0 and 1. The default colors are `c1 = RGB::Green`, `c2 = RGB::Yellow`, `c3 = RGB::Red`.

#### Returns

an object of the domain type `plot::Group`.

#### Details

- The rectangle Q is divided into 2^n * 2^n subrectangles. With the default value `n = 6`, the drawing area is divided into 64 * 64 subrectangles. This default produces a rather ``discretized'' plot. ``Smoother'' plots are generated by larger values of `n`. Note, however, that increasing `n` by 1 may increase the run time by a factor of 4.
- A subrectangle is displayed with the color `c1` if all its points (x,y) satisfy f1(x,y)>0 and f2(x,y)>0 etc. Consequently, all points of this color are guaranteed to satisfy (1).
- A subrectangle is displayed with the color `c3` if there is at least one function f.i such that all points in the subrectangle satisfy f.i(x,y)<0. Consequently, all points of this color are guaranteed to violate (1).
- The remaining subrectangles are displayed with the color `c2`. They cover the boundary of the region defined by the inequalities (1).
- An object generated by `plot::inequality` may be passed to the function `plot::Scene` to create a graphical scene. In the call to `plot::Scene`, you may specify scene options. Call `plot(...)` to display the scene.

  Alternatively, if the scene consists of only one ``inequality object'', you can pass this object directly to `plot` together with scene options.

- Interval arithmetic is used to check the inequalities. The input functions must be suitable for this kind of arithmetic, i.e., the calls `f1(Dom::Interval(left..right), Dom::Interval(bottom..top))` etc. must produce valid intervals. In MuPAD, interval implementations exist for most of the elementary functions such as `sin`, `exp`, `ln` etc. However, special functions such as Bessel functions, polylogarithms etc. must not turn up in `f1, f2, ...`.

#### Example 1

    >> f1:= (x,y) -> x^2 + y^2 - 1:
       p1:= plot::inequality([f1], -1..1, -1..1, 5)

                                   plot::Group()

    >> plot(p1, Scaling = Constrained, Axes = Box)

    >> f2:= (x,y) -> cos(x) - y: f3:= (x,y) -> cos(x) + y:
       p23:= plot::inequality([f2, f3], -PI..PI, -2..2, 5)

                                   plot::Group()

    >> plot(p23, Scaling = Constrained, Axes = Box)

    >> p123:= plot::inequality(
                [f1, f2, f3], -2..2, -1..1, 5,
                Colors = [RGB::Red, RGB::Black, RGB::White])

                                   plot::Group()

    >> plot(p123, Scaling = Constrained, Axes = Box)

#### Changes

- new function

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000