plot::Parallelogram3d

3D parallelograms

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.

Syntax

plot::Parallelogram3d([cx, cy, cz], [ux, uy, uz], [vx, vy, vz], <a = amin .. amax>, options)

Description

plot::Parallelogram3d(c, u, v) defines a 3D parallelogram with center and vectors , spanning the plane of the parallelogram. This is a rectangle with sides of length , if the vectors and are orthogonal.

plot::Parallelogram3d creates a 3D parallelogram with center = [cx, cy, cz] and sides given by the vectors = [2 ux, 2 uy, 2 uz] and = [2 vx, 2 vy, 2 vz]. The corners of the parallelogram are given by , , , and :

By default, the area of the parallelogram is filled with the color specified by the attribute Color or, equivalently, FillColor. With Filled = FALSE, only the border lines of the parallelogram are visible. Their color is set by the attribute LineColor.

Alternatively, the center and the spanning vectors can be given as vectors.

Attributes

AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
Centercenter of objects, rotation center[0, 0, 0]
CenterXcenter of objects, rotation center, x-component0
CenterYcenter of objects, rotation center, y-component0
CenterZcenter of objects, rotation center, z-component0
Colorthe main colorRGB::LightBlue
Filledfilled or transparent areas and surfacesTRUE
FillColorcolor of areas and surfacesRGB::LightBlue
FillColor2second color of areas and surfaces for color blendsRGB::CornflowerBlue
FillColorTypesurface filling typesFlat
FillColorDirectionthe direction of color transitions on surfaces[0, 0, 1]
FillColorDirectionXx-component of the direction of color transitions on surfaces0
FillColorDirectionYy-component of the direction of color transitions on surfaces0
FillColorDirectionZz-component of the direction of color transitions on surfaces1
Framesthe number of frames in an animation50
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?FALSE
LineColorcolor of linesRGB::Black.[0.25]
LineWidthwidth of lines0.35
LineStylesolid, dashed or dotted lines?Solid
LinesVisiblevisibility of linesTRUE
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 
Tangent1first vector spanning parallelograms[0, 1, 0]
Tangent2second vector spanning parallelograms[1, 0, 0]
Tangent1Xfirst vector spanning parallelograms, x component0
Tangent1Yfirst vector spanning parallelograms, y component1
Tangent2Xsecond vector spanning parallelograms, x component1
Tangent1Zfirst vector spanning parallelograms, z component0
Tangent2Ysecond vector spanning parallelograms, y component0
Tangent2Zsecond vector spanning parallelograms, z component0
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
Titleobject title 
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
TitlePositionZposition of object titles, z component 
VisiblevisibilityTRUE
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE

Examples

Example 1

Plot several rectangles and parallelograms using different presentation styles:

plot(plot::Parallelogram3d([1, 1, 1], [0, 0, 2], [0, 3, 0]),
     plot::Parallelogram3d([2, 2, 2], [0, 1, 4], [0, 2, 0],
                           FillColor = RGB::Red.[0.5]), 
     plot::Parallelogram3d([3, 3, 3], [0, 1, 1], [0, 1, -1],
                           Filled = FALSE, LineStyle = Dashed,
                           LineColor = RGB::Black), 
     plot::Parallelogram3d([4, 4, 4], [0, 1, 2], [0, 2, -2], 
                           Filled = FALSE, LineColor = RGB::Green)
):

Example 2

Use plot::Parallelogram3d to visualize tangent planes of a surface. The first surface is the graph of the function f(x, y) = x2 + y2. At a point (x, y, f(x, y)) on the graph, the tangent vectors in the x and y direction are given by (1, 0, 2 x) and (0, 1, 2 y), respectively. After normalization to the length 0.4, they yield the tangent vectors u, v used in the construction of the tangent planes:

f := (x, y) -> x^2 + y^2:
c:= (x, y) -> [x, y, f(x, y)]:
u := (x, y) -> [0.4/sqrt(1+4*x^2), 0, 0.8*x/sqrt(1+4*x^2)]:
v := (x, y) -> [0, 0.4/sqrt(1+4*y^2), 0.8*y/sqrt(1+4*y^2)]:
plot(plot::Function3d(f(x, y), x = -1..1, y = -1..1),
     plot::Parallelogram3d(c(0, 0), u(0, 0), v(0, 0),
                           Color = RGB::Grey.[0.5]),
     plot::Parallelogram3d(c(0, -1), u(0, -1), v(0, -1),
                           Color = RGB::Grey.[0.5]),
     plot::Parallelogram3d(c(-1, 0), u(-1, 0), v(-1, 0),
                           Color = RGB::Grey.[0.5]),
     plot::Parallelogram3d(c(-1/2, -1/2), u(-1/2, -1/2), 
                           v(-1/2, -1/2), 
                           Color = RGB::Grey.[0.5])):

The second surface is a sphere, parametrized by spherical coordinates p and t (polar and azimuth angle). At a point (x(p, t), y(p, t), z(p, t)) on the sphere, the tangent vectors in the p and t direction are given by differentiation of x, y, z with respect to p and t, respectively. After normalization to the length 0.5, they yield the tangent vectors u, v used in the construction of the tangent planes:

x := (p, t) -> cos(p)*sin(t):
y := (p, t) -> sin(p)*sin(t):
z := (p, t) -> cos(t):
c := (p, t) -> [x(p, t), y(p, t), z(p, t)]:
u := (p, t) -> [-0.5*sin(p), 0.5*cos(p), 0]:
v := (p, t) -> [0.5*cos(p)*cos(t), 0.5*sin(p)*cos(t), 
                -0.5*sin(t)]:
plot(plot::Surface(c(p, t), p = 0..2*PI, t = 0..PI),
     plot::Point3d(c(0, 0), Color = RGB::Black), 
     plot::Parallelogram3d(c(0, 0), u(0, 0), v(0, 0),
                           Color = RGB::Grey.[0.5]),
     plot::Point3d(c(-3*PI/4, PI/4), Color = RGB::Black), 
     plot::Parallelogram3d(c(-3*PI/4, PI/4), 
                           u(-3*PI/4, PI/4), 
                           v(-3*PI/4, PI/4), 
                           Color = RGB::Grey.[0.5]),
     plot::Point3d(c(-PI/2, PI/3), Color = RGB::Black), 
     plot::Parallelogram3d(c(-PI/2, PI/3),
                           u(-PI/2, PI/3), 
                           v(-PI/2, PI/3), 
                           Color = RGB::Grey.[0.5]),
     plot::Point3d(c(PI, PI/2), Color = RGB::Black), 
     plot::Parallelogram3d(c(PI, PI/2), 
                           u(PI, PI/2), 
                           v(PI, PI/2),
                           Color = RGB::Grey.[0.5]),
     Scaling = Constrained):

delete f, c, u, v, x, y, z:

Parameters

cx, cy, cz

Coordinates of the center: real numerical values or expressions of the animation parameter a.

cx, cy, cz are equivalent to the attributes CenterX, CenterY, CenterZ.

ux, uy, uz

Components of the first vector spanning the parallelogram: real numerical values or expressions of the animation parameter a.

ux, uy, uz are equivalent to the attributes Tangent1X, Tangent1Y, Tangent1Z.

vx, vy, vz

Components of the second vector spanning the parallelogram: real numerical values or expressions of the animation parameter a.

vx, vy, vz are equivalent to the attributes Tangent2X, Tangent2Y, Tangent2Z.

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