function draw_circle(r,x0,y0,line_style) % draw_circle Draw a circle in the (x,y) plane % % Synopsis: draw_circle(r) % draw_circle(r,x0) % draw_circle(r,x0,y0) % % Input: r = radius of the circle % x0,y0 = x and y coordinates of the center of the circle % Default: x0 = 0, y0 = 0; if nargin<2, x0 = 0; end if nargin<3, y0 = 0; end if nargin<4, line_style = '-'; end t = linspace(0,2*pi); x = x0 + r*cos(t); y = y0 + r*sin(t); plot(x,y,line_style)