# 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.

# `UMesh`, `VMesh`, `USubmesh`, `VSubmesh`

Number of sample points

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

## Value Summary

 `UMesh`, `USubmesh`, `VMesh`, `VSubmesh` Inherited Positive integer

## Graphics Primitives

ObjectsDefault Values
`plot::Curve2d`, `plot::Curve3d`, `plot::Polar`

`UMesh`: `121`

`USubmesh`: `0`

`plot::Cylindrical`, `plot::Spherical`, `plot::Surface`, `plot::XRotate`, `plot::ZRotate`

`UMesh`, `VMesh`: `25`

`USubmesh`, `VSubmesh`: `0`

`plot::Rootlocus`

`UMesh`: `51`

`plot::Sweep`

`UMesh`: `25`

`USubmesh`: `4`

`plot::Plane`

`UMesh`, `VMesh`: `15`

`plot::Tube`

`UMesh`: `60`

`VMesh`: `11`

`USubmesh`: `0`

`VSubmesh`: `1`

`plot::Ode2d`, `plot::Ode3d`

`USubmesh`: `4`

## Description

The attributes `UMesh` etc. determine the number of sample points used for the numerical approximation of parameterized plot objects such as curves and surfaces.

Many plot objects have to be evaluated numerically on a discrete mesh. The attributes described on this help page serve for setting the number of sample points of the numerical mesh.

For curves in 2D and 3D given by a parametrization x(u), y(u) and, possibly, z(u) with the curve parameter u, the attribute `UMesh = n` creates a numerical mesh of n equidistant u values. The attribute `USubmesh = m` inserts additional m mesh points between each pair of adjacent points set by `UMesh`.

The combinations `UMesh = n`, ```USubmesh = m``` and `UMesh = (m + 1) (n - 1) + 1`, ```USubmesh = 0``` are equivalent.

Specifying `Mesh`, `Submesh` has the same effekt as specifying `UMesh`, `USubmesh`.

The sample points of a curve can be made visible by setting ```PointsVisible = TRUE```.

Surface objects in 3D are parameterized by coordinate functions x(u, v), y(u, v), z(u, v) of two surface parameters u, v.

The attribute `UMesh = nu` sets the number nu of sample points for the first surface parameter. The attribute ```VMesh = nv``` sets the number nv of sample points for the second surface parameter. The parametrization is evaluated on a regular mesh of nu×nv values of the surface parameters u, v.

With the `USubmesh`, `VSubmesh` attributes, additional equidistant sample points can be inserted between each pair of adjacent sample points set by the `UMesh`, `VMesh` attributes.

With `ULinesVisible = TRUE` and ```VLinesVisible = TRUE```, respectively, the parameter lines of the regular mesh set by the attributes `UMesh`, `VMesh` are displayed on the surface. Additonal points inserted via `USubmesh`, `VSubmesh` do not create additional parameter lines.

You can also specify `UMesh = nu`, ```VMesh = nv```, `USubmesh = mu`, ```VSubmesh = mv``` in the shorter form `Mesh` = ```[nu, nv]```, `Submesh` = ```[mu, mv]```.

If adaptive sampling is enabled, further non-equidistant sample points are chosen automatically between the equidistant points of the `initial mesh' set via the ```UMesh, USubmesh, VMesh, VSubmesh``` attributes.

## Examples

### Example 1

It is possible to use low settings of mesh parameters to achieve special effects. As an example, we draw a parametrization of a circle with just six evaluation points:

```plot(plot::Curve2d([cos(t), sin(t)], t = 0..2*PI, UMesh = 6, Scaling = Constrained))```

The reason we get a pentagon here and not a hexagon is that the first and the last evaluation points coincide: six points in a line means five line segments.

With `UMesh = 30`, the circle looks like a circle:

```plot(plot::Curve2d([cos(t), sin(t)], t = 0..2*PI, UMesh = 30, Scaling = Constrained))```

### Example 2

The default values of `UMesh`, `VMesh` do not provide a sufficient resolution for the following graphics:

```plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI)):```

The spiral winds around the z-axis 5 times. We wish to have approximately 40 sample points per revolution, so we need to use a total of 200 sample points with respect to the angle parameter `phi`. The coordinate lines related to the radial parameter `r` are straight lines, so a very low resolution in this direction suffices:

```plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI, UMesh = 2, VMesh = 200)):```

When refining the mesh via `VSubmesh`, no additional parameter lines are created:

```plot(plot::Surface([r*cos(phi), r*sin(phi), r*phi], r = 0.. 1, phi = 0..10*PI, UMesh = 2, VMesh = 25, VSubmesh = 8)):```