| Contents | Index |
plot::Polar creates parameterized curves in 2D, with parametrization in polar coordinates.
Call:
plot::Polar([r,
], u =
..
, <a = amin .. amax>, Options)
Parameters:
|
r, |
the coordinate functions: arithmetical expressions or piecewise objects depending on the curve parameter |
|
u: |
the curve parameter: an identifier or an indexed identifier. |
|
|
the plot range for the parameter |
See Also:
plot, plot::copy, plot::Curve2d, plot::Cylindrical, plot::Spherical
Details:
plot::Polar creates curves in one parameter, with parametrization in polar coordinates and possibly animated (see examples 1 and 2). The curves may contain poles, in which case automatic clipping is used by default, see example 4.
Polar coordinates consist of a radius and an angle. The radius of a point is its distance from the origin
, while the angle is the angle between the positive “
”-axis (the ordinate) and the connection between the point and the origin, measured in radians and counter-clockwise.
By default, curves are sampled at equidistant values of the parameter t. The attribute AdaptiveMesh can be used to change this behavior, such that a denser sampling rate is used in areas of higher curvature. Cf. example 3.
Curves are graphical objects that can be manipulated, see the examples and the documentation of the parameters listed below for details.
Example 1
The most basic example of a curve in polar coordinates is a circle: Using a constant radius, the angle goes from
to
:
plot(plot::Polar([1, u], u = 0..2*PI))

A constant angle, on the other hand, means a straight line through the origin:
plot(plot::Polar([r, 1], r = 0..1))

plot::Polar accepts negative radii:
plot(plot::Polar([r, 1], r = -1..1))

The most simple “interesting” example is probably Archimedes' spiral:
plot(plot::Polar([r, r], r = 0..5*PI))

Example 2
Polar curves can be animated just like almost anything else:
plot(plot::Polar([r, a*r], r = 0..5*PI, a = -1..1))


Example 3
In some cases, the default of
evaluations on the curve is not sufficient and causes visible artifacts:
plot(plot::Polar([r, 4*r^2], r = 0..PI))

One remedy for this problem is to increase the number of evaluation points:
plot(plot::Polar([r, 4*r^2], r = 0..PI, Mesh = 400))

This method is, however, wasteful: Near the center, the initial density was perfectly sufficient, while on the outer edge still more points would be desirable. plot::Polar offers adaptive mesh refinement for exactly these situations. In the following example, we switch on adaptive mesh refinement with up to
points introduced between each two consecutive points of the initial mesh:
plot(plot::Polar([r, 4*r^2], r = 0..PI, AdaptiveMesh=4))

Example 4
If the curve (i.e., the radius expression/function) contains poles, plot::Polar will use heuristics to clip the viewing box:
plot(plot::Polar([tan(t)+1, t], t = 0..2*PI))

To select a different area, use the attribute ViewingBox:
plot(plot::Polar([tan(t)+1, t], t = 0..2*PI,
ViewingBox = [-2..2, -2..2]))

Example 5
plot::Polar creates objects that can be manipulated interactively and/or programmatically:
p := plot::Polar([tan(t)+1, t], t = 0..PI)
![]()
p::UMax := 2*PI:
p
![]()
p::ViewingBox := [-2..2, -2..2]:
p::LineColor := RGB::Blue:
p::LineWidth := 1*unit::mm:
plot(p)


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 |