-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawCircle.m
30 lines (26 loc) · 881 Bytes
/
DrawCircle.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function DrawCircle(x, y, r, nseg, S)
% Draw a circle on the current figure using ploylines
%
% DrawCircle(x, y, r, nseg, S)
% A simple function for drawing a circle on graph.
%
% INPUT: (x, y, r, nseg, S)
% x, y: Center of the circle
% r: Radius of the circle
% nseg: Number of segments for the circle
% S: Colors, plot symbols and line types
%
% OUTPUT: None
%
% BUG REPORT:
% Please send your bug reports, comments and suggestions to
% [email protected] . Thanks.
% Author: Tao Peng
% Department of Mechanical Engineering
% University of Maryland, College Park, Maryland 20742, USA
% Version: alpha Revision: Jan. 10, 2006
theta = 0 : (2 * pi / nseg) : (2 * pi);
pline_x = r * cos(theta) + x;
pline_y = r * sin(theta) + y;
plot(pline_x, pline_y, S);