source: Sophya/trunk/Cosmo/RadioBeam/vnpairs.h@ 4045

Last change on this file since 4045 was 3489, checked in by ansari, 17 years ago

Les differents scripts+prog de calcul P(k)/bruit, lobe, config interfero ajoute ds ce module - Reza 28/04/2008

File size: 1.3 KB
RevLine 
[3489]1Matrix hexagon(double xc, double yc, double r=1., double theta=0.)
2{
3 Matrix hex(2,7);
4 hex(0,0) = xc; hex(1,0) = yc;
5 for(int i=1; i<=6; i++) {
6 double tet = (i-1)*M_PI/3.+theta;
7 hex(0,i) = r*cos(tet)+xc;
8 hex(1,i) = r*sin(tet)+yc;
9 }
10 return hex;
11}
12
13Matrix couche(int num, double r=0.)
14{
15 if (num <= 0) {
16 Matrix pos(3,1);
17 pos(0,0) = pos(1,0) = pos(2,0) = 0.;
18 return pos;
19 }
20 else {
21 if (r <= 0.0001) r = 5.*num;
22 int n = num*6;
23 double tet0 = 0.;
24 tet0 = M_PI/n;
25 double dtet = M_PI*2./(double)n;
26 Matrix pos(3, n);
27 for(int i=0; i<n; i++) {
28 double tet = i*dtet+tet0;
29 pos(0,i) = r*cos(tet);
30 pos(1,i) = r*sin(tet);
31 pos(2,i) = tet;
32 }
33 return pos;
34 }
35}
36
37int FillVis(Histo2D& h2, double x, double y, double d=1)
38{
39 h2.Add(x, y, 1.);
40
41 double wa = 0.6;
42 double wb = 0.3;
43 for(int i=0; i<6; i++) {
44 double dx1a = 0.35*cos(i*M_PI/3.)*d;
45 double dy1a = 0.35*sin(i*M_PI/3.)*d;
46 double dx1b = 2*dx1a;
47 double dy1b = 2*dy1a;
48 for(int j=0; j<6; j++) {
49 double dx2a = 0.35*cos(j*M_PI/3.)*d;
50 double dy2a = 0.35*sin(j*M_PI/3.)*d;
51 double dx2b = 2*dx2a;
52 double dy2b = 2*dy2a;
53 h2.Add((x+dx1a-dx2a), (y+dy1a-dy2a), wa);
54 h2.Add((x+dx1b-dx2b), (y+dy1b-dy2b), wb);
55 }
56 }
57 return 0;
58}
Note: See TracBrowser for help on using the repository browser.