Documentation

# `Center`, `CenterX`, `CenterY`, `CenterZ`

Center of objects, rotation center

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

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

 `Center` Library wrapper for “[`CenterX`, `CenterY`]” (2D), “[`CenterX`, `CenterY`, `CenterZ`]” (3D) List of 2 or 3 expressions, depending on the dimension `CenterX`, `CenterY`, `CenterZ` Mandatory MuPAD® expression

## Description

The vector `Center` determines the center of various objects such a circles, spheres, pie charts etc. In rotation objects, it refers to the center of rotation.

Depending on the dimension of the object, it is given by a list or vector of 2 or 3 components.

`CenterX` etc. refer to the x, y, z components of this vector.

`Center`, `CenterX` etc. also denotes the rotation center in rotation objects of type `plot::Rotate2d` or `plot::Rotate3d`.

The values of these attributes can be animated.

## Examples

### Example 1

We create circles around the origin:

```c1 := plot::Circle2d(1, [0, 0]): c2 := plot::Circle2d(2, [0, 0]):```

The second argument in `plot::Circle2d` is the center. Internally, it is stored as the attribute `Center` and can be changed by assigning a new value:

```c1::Center := [1, 0]: c2::Center := [-1, 1]: plot(c1, c2):```

`delete c1, c2:`

### Example 2

We create an ellipse with an animated center. A copy of it is rotated around this center:

```e1 := plot::Ellipse2d(1, 3, Center = [a, a], a = 0..5): e2 := plot::Rotate2d(e1, Angle = a*PI/2, Center = e1::Center, a = 0..5): plot(e1, e2)```

`delete e1, e2:`

### Example 3

We create a sphere of radius 2 and change the default center `[0, 0, 0]` to ```[1, 2, 3]```:

```s := plot::Sphere(2): s::Center := [1, 2, 3]: plot(s)```

`delete s:`