Shift, ShiftX, ShiftY, ShiftZ

Shift vector

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

ShiftLibrary wrapper for “[ShiftX, ShiftY]” (2D), “[ShiftX, ShiftY, ShiftZ]” (3D)List of 2 or 3 expressions, depending on the dimension
ShiftX, ShiftY, ShiftZOptionalMuPAD® expression

Description

Shift is the shift vector in transformation objects. ShiftX etc. refer to the single components of this vector.

The general transformation objects plot::Transform2d and plot::Transform3d allow to apply the affine-linear transformation to 2D and 3D objects, respectively. The shift vector b can be accessed and changed via the attribute Shift.

Special transformation objects such as plot::Translate2d, plot::Translate3d correspond to special matrices A and shifts b. They also allow to access and change the shift vector by the attribute Shift.

When setting the Shift attribute, matrices, arrays, and lists with 2 or 3 elements are accepted. Internally, however, the shift data are always stored as the list [b1, b2] in 2D or [b1, b2, b3] in 3D, respectively. When reading the vector by a slot access, this list is returned.

The entries of Shift can be animated.

Examples

Example 1

We move an arrow along the y-axis:

T := plot::Translate2d([0, a], a = 0..5,
                       plot::Arrow2d([0, 0], [1, 1])):
plot(T)

The Shift vector is the first argument in the call above. It is stored in the corresponding slot of the translation object T:

T::Shift

We change the shift vector:

T::Shift := [a, 0]:
plot(T)

delete T:

See Also

MuPAD Functions