Skip to Main Content Skip to Search
Product Documentation

plot::Point2d2D points

plot::Point3d3D points

plot::Point2d(x, y) creates a two-dimensional point with the coordinates (x, y).

plot::Point3d(x, y, z) creates a three-dimensional point with the coordinates (x, y, z).

→ Examples

Calls:

plot::Point2d(x, y, <a = amin .. amax>, Options)

plot::Point2d([x, y], <a = amin .. amax>, Options)

plot::Point2d(matrix([x, y]), <a = amin .. amax>, Options)

plot::Point3d(x, y, z, <a = amin .. amax>, Options)

plot::Point3d([x, y, z], <a = amin .. amax>, Options)

plot::Point3d(matrix([x, y, z]), <a = amin .. amax>, Options)

Parameters:

x, y, z

arithmetical expressions
x, y, z are equivalent to the attributes Position, PositionX, PositionY, PositionZ.

See Also:

plot, plot::copy, plot::Polygon2d, plot::Polygon3d

Details:

Example 1

We create three points:

p1 := plot::Point2d(1, 3, PointSize = 4*unit::mm);
p2 := plot::Point2d(2, 2, PointSize = 5*unit::mm);
p3 := plot::Point2d(3, 1, Color = RGB::Green,
                    PointSize = 6*unit::mm);

plot::Point2d(1, 3, PointSize = 4)
plot::Point2d(2, 2, PointSize = 5)
plot::Point2d(3, 1, PointColor = RGB::Green, PointSize = 6)

To have these points displayed, we use plot:

plot(p1, p2, p3)

MuPAD graphics

It is possible to set global options directly in the call to plot:

plot(p1, p2, p3, PointStyle = FilledDiamonds)

MuPAD graphics

These options are regarded as the new defaults. This implies that objects having an option set explicitly will silently ignore these options. The green point stays green:

plot(p1, p2, p3, PointStyle = FilledDiamonds,
     PointColor = RGB::Red)

MuPAD graphics

Example 2

The point position can be animated. As an example, we combine a point with a curve that traces the path of the point:

x := t -> sin(3*t);
y := t -> cos(5*t);
p := plot::Point2d([x(t), y(t)], t = 0..2*PI);
c := plot::Curve2d([x(t), y(t)], t = 0..tmax, tmax = 0..2*PI)

t -> sin(3*t)
t -> cos(5*t)
plot::Point2d(sin(3*t), cos(5*t), t = 0..2*PI)
plot::Curve2d([sin(3*t), cos(5*t)], t = 0..tmax)

plot(c, p, PointSize = 3*unit::mm, LineWidth = 0.5*unit::mm)

MuPAD graphicsimage

Background:

For reasons of efficiency and clarity in the object browser, you should avoid generating large numbers of plot::Point2d and plot::Point3d objects. None of the domains in the plot package do. For alternatives, consider plot::PointList2d and plot::PointList3d.

  


Recommended Products

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