expcreatecircle

PURPOSE ^

EXPCREATECIRCLE - create a circular contour corresponding to given parameters

SYNOPSIS ^

function expcreatecircle(filename,x0,y0,radius,numberofgrids)

DESCRIPTION ^

EXPCREATECIRCLE - create a circular contour corresponding to given parameters

   Creates a closed argus contour centered on x,y of radius size.
   The contour is made of numberofgrids

   Usage:
      expcreatecircle(filename,x0,y0,radius,numberofgrids)

   See also EXPMASTER, EXPDOC

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function expcreatecircle(filename,x0,y0,radius,numberofgrids)
0002 %EXPCREATECIRCLE - create a circular contour corresponding to given parameters
0003 %
0004 %   Creates a closed argus contour centered on x,y of radius size.
0005 %   The contour is made of numberofgrids
0006 %
0007 %   Usage:
0008 %      expcreatecircle(filename,x0,y0,radius,numberofgrids)
0009 %
0010 %   See also EXPMASTER, EXPDOC
0011 
0012 %Calculate the cartesians coordinates of the points
0013 x_list=ones(numberofgrids,1);
0014 y_list=ones(numberofgrids,1);
0015 
0016 theta=(0:2*pi/numberofgrids:2*pi*(1-1/numberofgrids))';
0017 
0018 x_list=radius*x_list.*cos(theta);
0019 y_list=radius*y_list.*sin(theta);
0020 
0021 %offset x_list and y_list by x0 and y0:
0022 x_list=x_list+x0;
0023 y_list=y_list+y0;
0024 
0025 contour.x=x_list;
0026 contour.y=y_list;
0027 contour.density=1;
0028 contour.name='circle';
0029 
0030 expwrite(contour,filename);

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003