source: issm/trunk/src/m/exp/expcircle.m@ 16137

Last change on this file since 16137 was 13395, checked in by Mathieu Morlighem, 12 years ago

merged trunk-jpl and trunk for revision 13393

File size: 784 bytes
Line 
1function expcircle(filename,x0,y0,radius,numberofnodes)
2%EXPCIRCLE - create a circular contour corresponding to given parameters
3%
4% Creates a closed argus contour centered on x,y of radius size.
5% The contour is made of numberofnodes
6%
7% Usage:
8% expcircle(filename,x0,y0,radius,numberofnodes)
9%
10% See also EXPMASTER, EXPDOC
11
12%Calculate the cartesians coordinates of the points
13x_list=ones(numberofnodes+1,1);
14y_list=ones(numberofnodes+1,1);
15
16theta=(0:2*pi/numberofnodes:2*pi*(1-1/numberofnodes))';
17theta=[theta;0];
18
19x_list=radius*x_list.*cos(theta);
20y_list=radius*y_list.*sin(theta);
21
22%offset x_list and y_list by x0 and y0:
23x_list=x_list+x0;
24y_list=y_list+y0;
25
26contour.x=x_list;
27contour.y=y_list;
28contour.density=1;
29contour.name='circle';
30
31expwrite(contour,filename);
Note: See TracBrowser for help on using the repository browser.