📄 drawcircle.m
字号:
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
% pengtao@glue.umd.edu . Thanks.
% Author: Tao Peng
% Department of Mechanical Engineering
% University of Maryland, College Park, Maryland 20742, USA
% pengtao@glue.umd.edu
% 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);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -