## `plot::spherical` -- generate plots in spherical coordinates

#### Introduction

`plot::spherical``([theta, phi, r], u = a..b, v = c..d)` represents a plot of the surface defined by (u,v) -> (theta(u,v); phi(u,v); r(u,v)) with (u,v) in [a,b] x [c,d] in the spherical coordinates theta, phi, r.

#### Call(s)

`plot::spherical([theta, phi, r], u = a..b, v = c..d))`

#### Parameters

`theta, phi, r` | - | arithmetical expressions in `u` and `v`
`u, v` | - | identifiers
`a, b, c, d` | - | arithmetical expressions
`option1, option2, ...` | - | plot option(s) for three-dimensional graphical objects

#### Returns

Call `plot(...)` to display the result on the screen.

a graphical object of the domain type `plot::Surface3d`.

#### Related Domains

`plot::Surface3d`

#### Related Functions

`plot`, `plot2d`, `plot::cylindrical`, `plot::polar`

#### Details

- The following relationship between spherical coordinates and Cartesian coordinates holds:

      x = r*cos(phi)*sin(theta), y = r*sin(phi)*sin(theta), z = r*cos(theta).

- The plot options `option1`, `option2`... must be valid plot options for three-dimensional graphical objects. See `plot::Surface3d` 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

We define a three-dimensional surface in spherical coordinates:

    >> s:= plot::spherical(
         [1, u, z], u = -PI..PI,  z = -1..1,  Grid = [20, 20]
       )

          plot::Surface3d([cos(u) sin(z), sin(u) sin(z), cos(z)],

             u = -PI..PI, z = -1..1)

    >> plot(s, Axes = Box)

#### Example 2

We plot the surface (phi, theta) -> [1, phi, theta] in [-PI,PI] x [0,PI] (setting the number of surface points to 20):

    >> delete phi, theta:
       plot(plot::spherical(
         [1, phi, theta], phi = -PI..PI,  theta = 0..PI, Grid = [20, 20]
       ), Axes = Box)

#### Changes

- used to be called `plotlib::sphericalplot`
- `plot::spherical` 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