source: issm/trunk/test/Validation/RoundIceSheet/CreateDomainOutline.m@ 16

Last change on this file since 16 was 16, checked in by Mathieu Morlighem, 16 years ago

Added new tests form ice1

  • Property svn:executable set to *
File size: 779 bytes
RevLine 
[16]1function contour=CreateDomainOutline(numberofpoints,radius)
2%This funtion returns the coordinates of points on a circular domain. There is numberofpoints points
3%The radius of the circle is by default 1 but can change it.
4%Radius is the radius of the circular domain you wish to create
5
6if ((floor(numberofpoints)-numberofpoints)~=0)
7 error('domainoutline argument must be a positive integer')
8end
9
10if ((radius-abs(radius))~=0)
11 error('radius must be a positive number')
12end
13
14%Calculate the cartesians coordinates of the points
15x_list=ones(numberofpoints,1);
16y_list=ones(numberofpoints,1);
17
18theta=(0:2*pi/numberofpoints:2*pi*(1-1/numberofpoints))';
19
20x_list=radius*x_list.*cos(theta);
21y_list=radius*y_list.*sin(theta);
22
23contour.x=x_list;
24contour.y=y_list;
25contour.density=1;
26
27end
Note: See TracBrowser for help on using the repository browser.