Institut de Robòtica i Informàtica Industrial

PlotCircle

PURPOSE ^

Plots a circle.

SYNOPSIS ^

function h=PlotCircle(x,y,r,varargin)

DESCRIPTION ^

 Plots a circle.

 Plots a circle given it center (x,y) and radious (r). Additional
 parameters can be given to adjust the style of the line (color, 
 linewidth, etc).

CROSS-REFERENCE INFORMATION ^

This function calls:
This function is called by:

SOURCE CODE ^

0001 function h=PlotCircle(x,y,r,varargin)
0002 % Plots a circle.
0003 %
0004 % Plots a circle given it center (x,y) and radious (r). Additional
0005 % parameters can be given to adjust the style of the line (color,
0006 % linewidth, etc).
0007 
0008   s=(2*pi)/100;
0009   a=0:s:2*pi;
0010   
0011   px=x+r*cos(a);
0012   py=y+r*sin(a);
0013   line([x x],[y y],varargin{1:end},'marker','+');
0014   h=line(px,py,varargin{1:end});


Institut de Robòtica i Informàtica Industrial

Generated on Fri 24-Jul-2009 12:32:50 by m2html © 2003