Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

plot::Reflect2d

Reflection about a 2D point or a line

MuPAD® notebooks are not recommended. 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.

Syntax

plot::Reflect2d([x1, y1], <[x2, y2]>, obj1, obj2, …, <a = amin .. amax>, options)

Description

plot::Reflect2d([x1, y1], object) reflects a 2D object about the point (x1, y1).

plot::Reflect2d([x1, y1], [x2, y2], object) reflects a 2D object about the line through the points (x1, y1) and (x2, y2).

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.

Attributes

AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
Framesthe number of frames in an animation50
Fromstarting point of arrows and lines 
FromXstarting point of arrows and lines, x-coordinate 
FromYstarting point of arrows and lines, y-coordinate 
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
Toend point of arrows and lines 
ToXend point of arrows and lines, x-coordinate 
ToYend point of arrows and lines, y-coordinate 

Examples

Example 1

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))

The following command shows two more useful variations. First, use plot::Line2d to display the line of reflection. Then, use plot::modify to change the line color of the mirrored function graph:

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)

Parameters

x1, y1, x2, y2

The coordinates of two points on a line: real numerical values or arithmetical expressions of the animation parameter a.

x1, y1, x2, y2 are equivalent to the attributes From, To, FromX, FromY, ToX, ToY.

obj1, obj2, …

Plot objects

a

Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives

Was this topic helpful?