Parameterized 2D curves
This functionality does not run in MATLAB.
plot::Curve2d([x, y]
,t = t_{min} .. t_{max}
, <a = a_{min} .. a_{max}
>,options
) plot::Curve2d(A_{2d}
,t = t_{min} .. t_{max}
, <a = a_{min} .. a_{max}
>,options
) plot::Curve2d(piecewiseF(t)
,t = t_{min} .. t_{max}
, <a = a_{min} .. a_{max}
>,options
)
plot::Curve2d([x(t), y(t)], t = t_{min}..
t_{max})
creates the planar curve
.
plot::Curve2d
plots curves in one parameter.
See Example 1,
You can use it to plot animated curves. See Example 2.
The curves can contain poles, in which case automatic clipping is used by default. See Example 4.
By default, curves are sampled at equidistant values of the
parameter t
. To change this behavior so that a
denser sampling rate is used in areas of higher curvature, use the
attribute AdaptiveMesh
. See Example 5.
Curves are graphical objects that can be manipulated. See the examples and the documentation for the attributes for details.
Attribute  Purpose  Default Value 

AdaptiveMesh  adaptive sampling  0 
AffectViewingBox  influence of objects on the ViewingBox of
a scene  TRUE 
AntiAliased  antialiased lines and points?  TRUE 
Color  the main color  RGB::Blue 
DiscontinuitySearch  semisymbolic search for discontinuities  TRUE 
Frames  the number of frames in an animation  50 
Legend  makes a legend entry  
LegendText  short explanatory text for legend  
LegendEntry  add this object to the legend?  TRUE 
LineColor  color of lines  RGB::Blue 
LineWidth  width of lines  0.35 
LineColor2  color of lines  RGB::DeepPink 
LineStyle  solid, dashed or dotted lines?  Solid 
LinesVisible  visibility of lines  TRUE 
LineColorType  line coloring types  Flat 
LineColorFunction  functional line coloring  
LineColorDirection  the direction of color transitions on lines  [0 , 1 ] 
LineColorDirectionX  xcomponent of the direction of color transitions on lines  0 
LineColorDirectionY  ycomponent of the direction of color transitions on lines  1 
Mesh  number of sample points  121 
Name  the name of a plot object (for browser and legend)  
ParameterEnd  end value of the animation parameter  
ParameterName  name of the animation parameter  
ParameterBegin  initial value of the animation parameter  
ParameterRange  range of the animation parameter  
PointSize  the size of points  1.5 
PointStyle  the presentation style of points  FilledCircles 
PointsVisible  visibility of mesh points  FALSE 
Submesh  density of submesh (additional sample points)  0 
TimeEnd  end time of the animation  10.0 
TimeBegin  start time of the animation  0.0 
TimeRange  the real time span of an animation  0.0 .. 10.0 
Title  object title  
TitleFont  font of object titles  [" sansserif " , 11 ] 
TitlePosition  position of object titles  
TitleAlignment  horizontal alignment of titles w.r.t. their coordinates  Center 
TitlePositionX  position of object titles, x component  
TitlePositionY  position of object titles, y component  
UMax  final value of parameter "u"  5 
UMesh  number of sample points for parameter "u"  121 
UMin  initial value of parameter "u"  5 
UName  name of parameter "u"  
URange  range of parameter "u"  5 .. 5 
USubmesh  density of additional sample points for parameter "u"  0 
Visible  visibility  TRUE 
VisibleAfter  object visible after this time value  
VisibleBefore  object visible until this time value  
VisibleFromTo  object visible during this time range  
VisibleAfterEnd  object visible after its animation time ended?  TRUE 
VisibleBeforeBegin  object visible before its animation time starts?  TRUE 
XFunction  function for x values  
YFunction  function for y values 
Archimedes' Spiral is defined by f(r)
= (r sin(r), r cos(r)).
The corresponding call to plot::Curve2d
reads:
curve := plot::Curve2d([r*sin(r), r*cos(r)], r = 0..35)
plot(curve)
Note that this particular example is even more straightforward
to plot using plot::Polar
.
Continuing the example from above, define an easy animation by making the angular part timedependent:
curve := plot::Curve2d([r*sin(rt), r*cos(rt)], r = 0..35, t = 0..2*PI, TimeEnd = 5, ViewingBox = [25..25, 25..25]): plot(curve)
Note that to start the animation, you have to doubleclick the image in the notebook and choose "Start" from the "Animation" menu.
Another useful and easy type of animation is achieved by animating the parameter range. This creates the illusion of the curve being drawn in real time:
curve := plot::Curve2d([sin(thet), cos(thet)], thet = 0..a, a = 0..2*PI): plot(curve)
Combining this with an animated LineColorFunction
, you
can even simulate motion:
colorfunc := (thet, x, y, a) > [athet, athet, 1.0]: curve := plot::Curve2d([sin(3*thet), sin(4*thet)], thet = a1..a, LineColorFunction = colorfunc, LineWidth = 1, a = 0..2*PI): plot(curve)
Curves with poles are automatically clipped:
curve := plot::Curve2d([(1+tan(3*t)^2)*sin(t), (1+tan(3*t)^2)*cos(t)], t = 0..2*PI): plot(curve);
You can explicitly set other values for viewing box:
curve::ViewingBox := [2..2, 2..2]: plot(curve)
By default, curves are drawn by evaluating at equidistant values of the curve parameter. For curves that have few regions of high curvature, this may be inappropriate:
plot(plot::Curve2d([arctan(t), t^210*exp(50*t^2)], t = PI..PI))
Note the hard "kink" at the bottom of the picture.
On the other hand, the remainder of the curve is sufficiently smooth,
so globally increasing the number of evaluation points is not desirable. AdaptiveMesh
makes plot::Curve2d
look
for these kinks and adaptively increase the mesh density in problematic
areas:
plot(plot::Curve2d([arctan(t), t^210*exp(50*t^2)], t = PI..PI, AdaptiveMesh = 2))
To display a curve in the complex plane, map the listvalued
function [Re, Im]
to the curve:
plot(plot::Curve2d([Re, Im](zeta(I*y+1/2)), y=0..42, AdaptiveMesh=3), XAxisTitle = "Re(z)", YAxisTitle = "Im(z)")

Realvalued expressions in 

A matrix of category 

A 

An identifier or an indexed identifier 

Realvalued expressions (possibly in the animation parameter) 

Animation parameter, specified as 