## `plot::yrotate` -- generate plots of surface of revolution (y-axis)

#### Introduction

`plot::yrotate``(f, x = a..b)` returns the surface of revolution defined by the function f(x) around the y-axis in the interval [a,b]. The rotation angle ranges from 0 to 2*PI.

`plot::yrotate``(f, x = a..b, Angle = r1..r2)` returns the surface of revolution defined by the function f(x) around the y-axis in the interval [a,b]. The rotation angle ranges from r1 to r2.

#### Call(s)

`plot::yrotate(f, x = a..b <, option1, option2>...)`
`plot::yrotate(f, x = a..b, Angle = r1..r2 <, option1, option2>...)`

#### Parameters

`f` | - | arithmetical expression in `x`
`x` | - | identifier
`a, b, r1, r2` | - | arithmetical expressions
`option1, option2, ...` | - | plot option(s) of the form `option = value`

#### Returns

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

#### Related Functions

`plot`, `plot::Surface3d`, `plot::xrotate`

#### Details

- The result of `plot::yrotate` is the surface (x,r) -> (x*cos(r), x*sin(r), f), where x ranges from a to b and r from 0 to 2*PI or r1 to r2, respectively. It is an object of the domain type `plot::Surface3d` in two variables, namely the identifier `x` and an identifier built of the name `"angle"`.
- Use the function `plot` to display the revolution created on the screen.
- The plot options `option1`, `option2`... must be valid plot options for three-dimensional graphical objects. See `plot3d` for details.

  Note that scene options are not allowed! You may give scene options as optional arguments for the function `plot`, or use `plot::Scene` to create an object representing a graphical scene.

#### Example 1

Let us revolve the sinus function around the y-axis in the interval x in [0, PI]:

    >> r:= plot::yrotate(sin(x), x = 1..3, Title = "")

          plot::Surface3d([x cos(angle1), x sin(angle1), sin(x)],

             x = 1..3, angle1 = 0..2 PI)

The result is a graphical object of the domain type `plot::Surface3d`. To display the surface on the screen, call `plot`:

    >> plot(r)

Here you can give scene options, for example, to change the style of the axis:

    >> plot(r, Axes = Box)

#### Example 2

We can restrict the rotation angle like in the following call:

    >> r2:= plot::yrotate(sin(x), x = 1..3, Angle = 0..PI):
       plot(r2)

Plot objects for the surface can be given together with the call of `plot::yrotate`, like in:

    >> r2:= plot::yrotate(sin(x), x = 1..3, Color = RGB::Blue):
       plot(r2)

Or use the slot operator `::` to get or set afterwards plot options of such graphical objects. For example, the rotation angle of the revolution `r2` is the y-variable of the surface kept in the attribute `range2`:

    >> angle:= r2::range2

                                 angle3 = 0..2 PI

Hence, to restrict the rotation angle to the interval [0,PI/2], we enter:

    >> r2::range2:= lhs(angle) = 0..PI/2:
       plot(r2)

#### Changes

- used to be called `plotlib::yrotate`
- `plot::yrotate` is now part of the new plot library `plot`, and thus its calling syntax and the return value were changed.

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