| 1 |
{ RCSid $Id$ }
|
| 2 |
{
|
| 3 |
Tregenza patch positions & solid angles
|
| 4 |
|
| 5 |
Greg Ward June 2005
|
| 6 |
|
| 7 |
The Tregenza sky uses 145 patches, with patch 1 pointing due
|
| 8 |
North at the horizon, and continuing around to the East to
|
| 9 |
patch 30, which comprises the first altitude row (alt = 6 degrees).
|
| 10 |
Each successive row increases altitude by 12 degrees, with the
|
| 11 |
final altitude at the zenith (90 degrees). Azimuth is evenly
|
| 12 |
divided among 30, 30, 24, 24, 18, 12, 6, and 1 divisions per row.
|
| 13 |
|
| 14 |
Input is Tbin from 1-145
|
| 15 |
Output is Dx Dy Dz theta (degree full angle of source)
|
| 16 |
}
|
| 17 |
DEGREE : PI/180;
|
| 18 |
|
| 19 |
Trow = if(30.5-Tbin, 1,
|
| 20 |
if(60.5-Tbin, 2,
|
| 21 |
if(84.5-Tbin, 3,
|
| 22 |
if(108.5-Tbin, 4,
|
| 23 |
if(126.5-Tbin, 5,
|
| 24 |
if(138.5-Tbin, 6,
|
| 25 |
if(144.5-Tbin, 7, 8) ) ) ) ) ) );
|
| 26 |
|
| 27 |
cols_row = select(Trow, 30, 30, 24, 24, 18, 12, 6, 1);
|
| 28 |
|
| 29 |
Tcol = Tbin - select(Trow, 0, 30, 60, 84, 108, 126, 138, 144);
|
| 30 |
|
| 31 |
Tazi_width = 2*PI / cols_row;
|
| 32 |
|
| 33 |
TAH : 12*DEGREE;
|
| 34 |
|
| 35 |
Tazi = (Tcol - 1)*Tazi_width;
|
| 36 |
Talt = (Trow - .5)*TAH;
|
| 37 |
|
| 38 |
Tomega = if(144.5-Tbin,
|
| 39 |
Tazi_width*(sin(TAH*Trow) - sin(TAH*(Trow-1))),
|
| 40 |
0.0344199465 );
|
| 41 |
|
| 42 |
cos_talt = cos(Talt);
|
| 43 |
|
| 44 |
Dx = sin(Tazi)*cos_talt;
|
| 45 |
Dy = cos(Tazi)*cos_talt;
|
| 46 |
Dz = sin(Talt);
|
| 47 |
|
| 48 |
theta = 2/DEGREE * acos(1 - Tomega/(2*PI));
|