# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# `plot`::`XRotate`

Surfaces of revolution around x-axis

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```plot::XRotate(`f`, `x = xmin .. xmax`, <`a = amin .. amax`>, `options`)
```

## Description

`plot::XRotate(f, x = xmin..xmax)` creates a surface of revolution by rotating the function graph y = f(x) with x ∈ [xmin, xmax] around the x-axis. The slice of the surface parallel to the y-z plane at a point x is a circle of radius f(x).

The range of the rotation can be restricted with the attributes `AngleBegin`, `AngleEnd`, `AngleRange`. The surface of revolution spans over the given range of the rotation angle.

Surfaces of revolution are parametrized surfaces. The first surface parameter is x, the second is the rotation angle. Surfaces of revolution react to most of the graphical attributes that surfaces of type `plot::Surface` react to. For example, use `Mesh` and `Submesh` to control the numerical mesh or use `ULinesVisible` and `VLinesVisible` to enable or disable the parameter lines.

## Attributes

AttributePurposeDefault Value
`AdaptiveMesh`adaptive sampling`0`
`AffectViewingBox`influence of objects on the `ViewingBox` of a scene`TRUE`
`AngleEnd`end of angle range`2*PI`
`AngleBegin`begin of angle range`0`
`AngleRange`angle range`0` .. `2*PI`
`Color`the main color`RGB::Red`
`Filled`filled or transparent areas and surfaces`TRUE`
`FillColor`color of areas and surfaces`RGB::Red`
`FillColor2`second color of areas and surfaces for color blends`RGB::CornflowerBlue`
`FillColorType`surface filling types`Dichromatic`
`FillColorFunction`functional area/surface coloring
`FillColorDirection`the direction of color transitions on surfaces[`0`, `0`, `1`]
`FillColorDirectionX`x-component of the direction of color transitions on surfaces`0`
`FillColorDirectionY`y-component of the direction of color transitions on surfaces`0`
`FillColorDirectionZ`z-component of the direction of color transitions on surfaces`1`
`Frames`the number of frames in an animation`50`
`Function`function expression or procedure
`Legend`makes a legend entry
`LegendText`short explanatory text for legend
`LegendEntry`add this object to the legend?`TRUE`
`LineColor`color of lines`RGB::Black.[0.25]`
`LineWidth`width of lines`0.35`
`LineColor2`color of lines`RGB::DeepPink`
`LineStyle`solid, dashed or dotted lines?`Solid`
`LineColorType`line coloring types`Flat`
`LineColorFunction`functional line coloring
`LineColorDirection`the direction of color transitions on lines[`0`, `0`, `1`]
`LineColorDirectionX`x-component of the direction of color transitions on lines`0`
`LineColorDirectionY`y-component of the direction of color transitions on lines`0`
`LineColorDirectionZ`z-component of the direction of color transitions on lines`1`
`Mesh`number of sample points[`25`, `25`]
`MeshVisible`visibility of irregular mesh lines in 3D`FALSE`
`Name`the name of a plot object (for browser and legend)
`ParameterEnd`end value of the animation parameter
`ParameterName`name of the animation parameter
`ParameterBegin`initial value of the animation parameter
`ParameterRange`range of the animation parameter
`PointSize`the size of points`1.5`
`PointStyle`the presentation style of points`FilledCircles`
`PointsVisible`visibility of mesh points`FALSE`
`Shading`smooth color blend of surfaces`Smooth`
`Submesh`density of submesh (additional sample points)[`0`, `0`]
`TimeEnd`end time of the animation`10.0`
`TimeBegin`start time of the animation`0.0`
`TimeRange`the real time span of an animation`0.0` .. `10.0`
`Title`object title
`TitleFont`font of object titles[`" sans-serif "`, `11`]
`TitlePosition`position of object titles
`TitleAlignment`horizontal alignment of titles w.r.t. their coordinates`Center`
`TitlePositionX`position of object titles, x component
`TitlePositionY`position of object titles, y component
`TitlePositionZ`position of object titles, z component
`ULinesVisible`visibility of parameter lines (u lines)`TRUE`
`UMesh`number of sample points for parameter “u”`25`
`USubmesh`density of additional sample points for parameter “u”`0`
`VLinesVisible`visibility of parameter lines (v lines)`TRUE`
`VMesh`number of sample points for parameter “v”`25`
`VSubmesh`density of additional sample points for parameter “v”`0`
`Visible`visibility`TRUE`
`VisibleAfter`object visible after this time value
`VisibleBefore`object visible until this time value
`VisibleFromTo`object visible during this time range
`VisibleAfterEnd`object visible after its animation time ended?`TRUE`
`VisibleBeforeBegin`object visible before its animation time starts?`TRUE`
`XContours`contour lines at constant x values[]
`XMax`final value of parameter “x”`5`
`XMin`initial value of parameter “x”`-5`
`XName`name of parameter “x”
`XRange`range of parameter “x”`-5` .. `5`
`YContours`contour lines at constant y values[]
`ZContours`contour lines at constant z values[]

## Examples

### Example 1

By default, `plot::XRotate` displays a complete revolution, just as if an object was created on a lathe:

`plot(plot::XRotate(2 - sin(x), x = 0..2*PI))`

This rotation is insensitive to negative values. The surfaces of revolution of f(x) and |f(x)| are identical:

```plot(plot::Scene3d(plot::XRotate(sin(x), x = 0..2*PI)), plot::Scene3d(plot::XRotate(abs(sin(x)), x = 0..2*PI)), Layout = Horizontal)```

This symmetry is broken when not performing a whole revolution:

```plot(plot::Scene3d(plot::XRotate(sin(x), x = 0..2*PI, AngleRange = -PI/2..PI/2)), plot::Scene3d(plot::XRotate(abs(sin(x)), x = 0..2*PI, AngleRange = -PI/2..PI/2)), Layout = Horizontal)```

`plot::XRotate` can be animated, like almost every plot object:

```plot(plot::XRotate(sin(x + a), x = 0 .. 2*a + PI, AngleRange = 0 .. PI + a/2, a = 0..2*PI))```

## Parameters

 `f` The function: an arithmetical expression or a `piecewise` object in the independent variable x and the animation parameter a. Alternatively, a procedure that accepts 1 input parameter x or 2 input parameters x, a and returns a real numerical value when the input parameters are numerical. `f` is equivalent to the attribute `Function`. `x` The independent variable: an identifier or an indexed identifier. `x` is equivalent to the attribute `XName`. `xmin .. xmax` The plot range: `xmin`, `xmax` must be numerical real values or expressions of the animation parameter a. `xmin` .. `xmax` is equivalent to the attributes `XRange`, `XMin`, `XMax`. `a` Animation parameter, specified as `a```` = amin..amax```, where `amin` is the initial parameter value, and `amax` is the final parameter value.