2D circles

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


plot::Circle2d(r, <[x, y]>, <a = amin .. amax>, options)


plot::Circle2d(r, [x, y]) creates a 2D circle with radius r and center (x, y).

The attribute LineColor or, equivalently, Color serves for setting the line color.

Use the attribute Filled = TRUE to create filled circles. You can choose between hatched and solidly filled circles via the attribute FillPattern. The fill color is determined by FillColor.

The circumferential line can be “switched off” via LinesVisible = FALSE.


AttributePurposeDefault Value
AffectViewingBoxinfluence of objects on the ViewingBox of a sceneTRUE
AntiAliasedantialiased lines and points?TRUE
Centercenter of objects, rotation center[0, 0]
CenterXcenter of objects, rotation center, x-component0
CenterYcenter of objects, rotation center, y-component0
Colorthe main colorRGB::Blue
Filledfilled or transparent areas and surfacesFALSE
FillColorcolor of areas and surfacesRGB::Red
FillPatterntype of area fillingDiagonalLines
Framesthe number of frames in an animation50
Legendmakes a legend entry 
LegendTextshort explanatory text for legend 
LegendEntryadd this object to the legend?FALSE
LineColorcolor of linesRGB::Blue
LineWidthwidth of lines0.35
LineStylesolid, dashed or dotted lines?Solid
LinesVisiblevisibility of linesTRUE
LineColorDirectionthe direction of color transitions on lines[0, 1]
LineColorDirectionXx-component of the direction of color transitions on lines0
LineColorDirectionYy-component of the direction of color transitions on lines1
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
Radiusradius of circles, spheres etc.1
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0
Titleobject title 
TitleFontfont of object titles[" sans-serif ", 11]
TitlePositionposition of object titles 
TitleAlignmenthorizontal alignment of titles w.r.t. their coordinatesCenter
TitlePositionXposition of object titles, x component 
TitlePositionYposition of object titles, y component 
VisibleAfterobject visible after this time value 
VisibleBeforeobject visible until this time value 
VisibleFromToobject visible during this time range 
VisibleAfterEndobject visible after its animation time ended?TRUE
VisibleBeforeBeginobject visible before its animation time starts?TRUE


Example 1

Create a circle by specifying only its radius. In this case, the circle is centered at the origin


You can specify the center of a circle by a list of its coordinates:

plot(plot::Circle2d(1, [1, 1]),
     plot::Circle2d(2, [1, 2]),
     plot::Circle2d(3, [1, 3])):

Example 2

You can animate the radius and center of a circle. Plot an animated circle with a changing radius and a center moving on a spiral:

plot(plot::Curve2d([a*cos(2*a), a*sin(2*a)], a = 0..PI),
     plot::Point2d([a*cos(2*a), a*sin(2*a)], a = 0..PI,
                   PointSize = 2*unit::mm),
     plot::Circle2d(0.2 + sin(a), [a*cos(2*a), a*sin(2*a)], 
                    a = 0..PI))



The radius: a real numerical value or an arithmetical expression in the animation parameter a.

r is equivalent to the attribute Radius.

x, y

The center of a circle. The coordinates x, y must be real numerical values or arithmetical expressions in the animation parameter a. If no center is specified, a circle centered at the origin is created.

x, y are equivalent to the attributes CenterX, CenterY.


Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives