Skip to Main Content Skip to Search
Product Documentation

plot::Polarcurves in 2D parameterized in polar coordinates

plot::Polar creates parameterized curves in 2D, with parametrization in polar coordinates.

→ Examples

Call:

plot::Polar([r, Symbol::phi], u = `u_{min}` .. `u_{max}`, <a = amin .. amax>, Options)

Parameters:

r, Symbol::phi

the coordinate functions: arithmetical expressions or piecewise objects depending on the curve parameter u and the animation parameter a. Alternatively, MuPAD procedures that accept 1 input parameter u or 2 input parameters u, a and return a real numerical value when the input parameters are numerical. 
r, Symbol::phi are equivalent to the attributes XFunction, YFunction.

u

the curve parameter: an identifier or an indexed identifier
u is equivalent to the attribute UName.

`u_{min}` .. `u_{max}`

the plot range for the parameter u: `u_{min}`, `u_{max}` must be numerical real values or expressions of the animation parameter a
`u_{min}` .. `u_{max}` is equivalent to the attributes URange, UMin, UMax.

See Also:

plot, plot::copy, plot::Curve2d, plot::Cylindrical, plot::Spherical

Details:

Example 1

The most basic example of a curve in polar coordinates is a circle: Using a constant radius, the angle goes from 0 to 2*PI:

plot(plot::Polar([1, u], u = 0..2*PI))

MuPAD graphics

A constant angle, on the other hand, means a straight line through the origin:

plot(plot::Polar([r, 1], r = 0..1))

MuPAD graphics

plot::Polar accepts negative radii:

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

MuPAD graphics

The most simple “interesting” example is probably Archimedes' spiral:

plot(plot::Polar([r, r], r = 0..5*PI))

MuPAD graphics

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

MuPAD graphicsimage

Example 3

In some cases, the default of 121 evaluations on the curve is not sufficient and causes visible artifacts:

plot(plot::Polar([r, 4*r^2], r = 0..PI))

MuPAD graphics

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

MuPAD graphics

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 2^4 = 16 points introduced between each two consecutive points of the initial mesh:

plot(plot::Polar([r, 4*r^2], r = 0..PI, AdaptiveMesh=4))

MuPAD graphics

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

MuPAD graphics

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

MuPAD graphics

Example 5

plot::Polar creates objects that can be manipulated interactively and/or programmatically:

p := plot::Polar([tan(t)+1, t], t = 0..PI)

plot::Polar([tan(t) + 1, t], t = 0..PI)

p::UMax := 2*PI:
p

plot::Polar([tan(t) + 1, t], t = 0..2*PI)

p::ViewingBox := [-2..2, -2..2]:
p::LineColor  := RGB::Blue:
p::LineWidth  := 1*unit::mm:
plot(p)

MuPAD graphics

  


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