| Contents | Index |
plot::Parallelogram2d(c, u, v) and plot::Parallelogram3d(c, u, v) defines a 2D, respectively 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.
Calls:
plot::Parallelogram2d([cx, cy], [ux, uy], [vx, vy], <a = amin .. amax>, Options)
plot::Parallelogram3d([cx, cy, cz], [ux, uy, uz], [vx, vy, vz], <a = amin .. amax>, Options)
Parameters:
|
cx, cy, cz: |
coordinates of the center: real numerical values or expressions of the animation parameter a. |
|
ux, uy, uz: |
components of the first vector spanning the parallelogram: real numerical values or expressions of the animation parameter a. |
|
vx, vy, vz: |
components of the second vector spanning the parallelogram: real numerical values or expressions of the animation parameter a. |
See Also:
plot, plot::Box, plot::copy, plot::Line3d, plot::Polygon3d, plot::Rectangle
Details:
plot::Parallelogram2d creates a 2D parallelogram with center
=
and sides given by the vectors
=
and
=
. The corners of the parallelogram are given by
,
,
, and
:

plot::Parallelogram3d creates a 3D parallelogram with center
=
and sides given by the vectors
=
and
=
. 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.
Example 1
We 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
We use plot::Parallelogram3d to visualize tangent planes of a surface. The first surface is the graph of the function
. At a point
on the graph, the tangent vectors in the
and
direction are given by
and
, respectively. After normalization to the length
, they yield the tangent vectors
,
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
and
(polar and azimuth angle). At a point
on the sphere, the tangent vectors in the
and
direction are given by differention of
w.r.t.
and
, respectively. After normalization to the length
, they yield the tangent vectors
,
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:

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |