Reflection about a 2D point or a line
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.
[x1, y1], <
obj1, obj2, …, <
a = amin .. amax>,
object) reflects a 2D object about the point
[x2, y2], object) reflects
a 2D object about the line through the points
Reflections in 2D are transformation objects that mirror their contents about a straight line. In the degenerate case where both points on the line coincide or if only one point is specified, they reflect about a point.
Like all transformation objects, reflections can contain any number of objects of the appropriate dimension. Plotting the reflection object renders the reflections of all graphical objects inside.
Reflections can be animated. If the contained objects are animated, too, the animations will run simultaneously.
Animated reflection objects are rather “cheap” concerning computing and storing costs. For more complex graphical objects, it is more efficient to use an animated reflection object than to redefine the object for each frame.
|influence of objects on the |
|the number of frames in an animation|
|starting point of arrows and lines|
|starting point of arrows and lines, x-coordinate|
|starting point of arrows and lines, y-coordinate|
|the name of a plot object (for browser and legend)|
|end value of the animation parameter|
|name of the animation parameter|
|initial value of the animation parameter|
|range of the animation parameter|
|end time of the animation|
|start time of the animation|
|the real time span of an animation|
|end point of arrows and lines|
|end point of arrows and lines, x-coordinate|
|end point of arrows and lines, y-coordinate|
Plot the reflection of a function graph about the origin:
plot(plot::Reflect2d([0, 0], plot::Function2d(x^2, x=-2..2)))
Reflecting a function about the main diagonal (the line through the origin and the point (1, 1) shows the (multivalued) inverse function:
plot(plot::Reflect2d([0, 0], [1, 1], plot::Function2d(x^2, x=-2..2)))
To display both an object and its mirror image, assign the object to some variable and plot both:
f := plot::Function2d(x^2, x=-2..2, LineWidth = 0.5): plot(f, plot::Reflect2d([0, 0], [1, 1], f))
g := plot::Line2d([0, 0], [1, 1], Color = RGB::Red, LineStyle = Dashed, Extension = Infinite): f1 := plot::Reflect2d([0, 0], [1, 1], plot::modify(f, LineColor = RGB::Green)): plot(f, g, f1)
The coordinates of two points on a line: real numerical values
expressions of the animation parameter
Animation parameter, specified as