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
|
Line | |
---|
1 | function 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 |
|
---|
6 | if ((floor(numberofpoints)-numberofpoints)~=0)
|
---|
7 | error('domainoutline argument must be a positive integer')
|
---|
8 | end
|
---|
9 |
|
---|
10 | if ((radius-abs(radius))~=0)
|
---|
11 | error('radius must be a positive number')
|
---|
12 | end
|
---|
13 |
|
---|
14 | %Calculate the cartesians coordinates of the points
|
---|
15 | x_list=ones(numberofpoints,1);
|
---|
16 | y_list=ones(numberofpoints,1);
|
---|
17 |
|
---|
18 | theta=(0:2*pi/numberofpoints:2*pi*(1-1/numberofpoints))';
|
---|
19 |
|
---|
20 | x_list=radius*x_list.*cos(theta);
|
---|
21 | y_list=radius*y_list.*sin(theta);
|
---|
22 |
|
---|
23 | contour.x=x_list;
|
---|
24 | contour.y=y_list;
|
---|
25 | contour.density=1;
|
---|
26 |
|
---|
27 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.