Skip to Main Content Skip to Search
Product Documentation

plot::Circle2d2D circles

plot::Circle3d3D circles

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

plot::Circle3d(r, [x, y, z], [nx, ny, nz]) creates a 3D circle with radius r, center (x, y, z), and normal vector (n_x, n_y, n_z).

→ Examples

Calls:

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

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

plot::Circle3d(r, [x, y, z], [nx, ny, nz], <a = amin .. amax>, Options)

Parameters:

r

the radius: a real numerical value or an arithmetical expression in the animation parameter a
r is equivalent to the attribute Radius.

x, y, z

the center. The coordinates x, y, z 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, z are equivalent to the attributes CenterX, CenterY, CenterZ.

nx, ny, nz

the normal vector. The components nx, ny, nz must be real numerical values or arithmetical expressions in the animation parameter a. If no normal is specified, the normal (0, 0, 1) is used. 
nx, ny, nz are equivalent to the attributes NormalX, NormalY, NormalZ.

Related Domains:

plot::Cone, plot::Sphere

Related Functions:

plot, plot::copy

Details:

Example 1

Circles centered at the origin are created if only a radius is specified:

plot(plot::Circle2d(3)):

MuPAD graphics

A center may be given as a list of coordinates:

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

MuPAD graphics

Example 2

Radius and center of a circle can be animated. We 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))

MuPAD graphicsimage

Example 3

In three dimensions, a circle requires a normal vector. We animate this vector:

normal_ := plot::Arrow3d(
      [0, 0, 0],
      [sin(2*a), sin(a)*cos(2*a), cos(a)*cos(2*a)],
      a = 0..2*PI):
circle := plot::Circle3d(1, [0, 0, 0], normal_::To,
                         a = 0..2*PI, Filled):
plot(normal_, circle)

MuPAD graphicsimage

  


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