| 1 | greg | 1.1 | { RCSid $Id$ } | 
| 2 |  |  | { | 
| 3 |  |  | Calculation of relay directions for prismatic glazing | 
| 4 |  |  |  | 
| 5 |  |  | 31 July 1991    Greg Ward | 
| 6 |  |  |  | 
| 7 |  |  | Prism is oriented with flat side in xz plane | 
| 8 |  |  | and normal in -y direction.  The prism is | 
| 9 |  |  | extruded along the x axis. | 
| 10 |  |  |  | 
| 11 |  |  | Reflections are not computed. | 
| 12 |  |  |  | 
| 13 |  |  | Parameters: | 
| 14 |  |  | A1              - index of refraction | 
| 15 |  |  | A2              - thickness of prism triangle | 
| 16 |  |  | A3              - height of upper side (segment 1) | 
| 17 |  |  | A4              - height of lower side (segment 2) | 
| 18 |  |  |  | 
| 19 |  |  | Computes: | 
| 20 |  |  | coef1   - transmission coefficient for upper side | 
| 21 |  |  | dx1, dy1, | 
| 22 |  |  | dz1     - transmission direction for upper side | 
| 23 |  |  | coef2   - transmission coefficient for lower side | 
| 24 |  |  | dx2, dy2, | 
| 25 |  |  | dz2     - transmission direction for lower side | 
| 26 |  |  | } | 
| 27 |  |  | { required formulae } | 
| 28 |  |  | tan2sin(a) = sqrt(a*a/(1+a*a)); | 
| 29 |  |  | stb(sta,ca,sa) = ca*sta - sa*sqrt(A1*A1-sta*sta); | 
| 30 |  |  | cos_p = Sqrt(1-Dx*Dx); | 
| 31 |  |  | dtrans(c1,c2) = dtransb(c1, sqrt(1+(c1*c1-1)/A1/A1), | 
| 32 |  |  | c2, sqrt(1+(c2*c2-1)/A1/A1)); | 
| 33 |  |  | dtransb(c1o,c1i,c2o,c2i) = 8*A1*A1 * | 
| 34 |  |  | ( c1o*c1i*c2o*c2i/sq((A1*c1o+c1i)*(A1*c2o+c2i)) + | 
| 35 |  |  | 1/c1o/c1i/c2o/c2i/sq((A1/c1o+1/c1i)*(A1/c2o+1/c2i)) ); | 
| 36 |  |  |  | 
| 37 |  |  | {************************************************ | 
| 38 |  |  | Definitions for Segment 1 | 
| 39 |  |  | } | 
| 40 |  |  | { slope angle (always positive) } | 
| 41 |  |  | sin_a1 = tan2sin(A2/A3/cos_p); | 
| 42 |  |  | cos_a1 = Sqrt(1-sin_a1*sin_a1); | 
| 43 |  |  | { computed coefficeint } | 
| 44 |  |  | coef1 = A3/(A3+A4) * if(Dy, | 
| 45 |  |  | if(1-abs(sin_tB1o), | 
| 46 |  |  | dtrans(cos_tA1i, cos_tB1o), | 
| 47 |  |  | 0), | 
| 48 |  |  | if (Dy*cos_a1 + Dz*sin_a1, | 
| 49 |  |  | 0, | 
| 50 |  |  | if (1-abs(sin_tA1o), | 
| 51 |  |  | dtrans(cos_tB1i, cos_tA1o), | 
| 52 |  |  | 0))); | 
| 53 |  |  | { computed direction } | 
| 54 |  |  | dx1 = Dx; | 
| 55 |  |  | dy1 = if(Dy, | 
| 56 |  |  | (cos_a1*cos_tB1o-sin_a1*sin_tB1o)*cos_p, | 
| 57 |  |  | -cos_tA1o*cos_p); | 
| 58 |  |  | dz1 = if(Dy, | 
| 59 |  |  | (sin_a1*cos_tB1o+cos_a1*sin_tB1o)*cos_p, | 
| 60 |  |  | -sin_tA1o*cos_p); | 
| 61 |  |  | { incident angle (flat side) } | 
| 62 |  |  | sin_tA1i = Dz/cos_p; | 
| 63 |  |  | cos_tA1i = Sqrt(1-sin_tA1i*sin_tA1i); | 
| 64 |  |  | { transmitted angle (steep side) } | 
| 65 |  |  | sin_tB1o = stb(sin_tA1i, cos_a1, sin_a1); | 
| 66 |  |  | cos_tB1o = Sqrt(1-sin_tB1o*sin_tB1o); | 
| 67 |  |  | { incident angle (steep side) } | 
| 68 |  |  | sin_tB1i = -Dz/cos_p*cos_a1 - | 
| 69 |  |  | Sqrt(1-sq(Dz/cos_p))*sin_a1; | 
| 70 |  |  | cos_tB1i = Sqrt(1-sin_tB1i*sin_tB1i); | 
| 71 |  |  | { transmitted angle (flat side) } | 
| 72 |  |  | sin_tA1o = stb(sin_tB1i, cos_a1, -sin_a1); | 
| 73 |  |  | cos_tA1o = Sqrt(1-sin_tA1o*sin_tA1o); | 
| 74 |  |  |  | 
| 75 |  |  | {************************************************ | 
| 76 |  |  | Definitions for Segment 2 | 
| 77 |  |  | } | 
| 78 |  |  | { slope angle (always negative) } | 
| 79 |  |  | sin_a2 = -tan2sin(A2/A4/cos_p); | 
| 80 |  |  | cos_a2 = Sqrt(1-sin_a2*sin_a2); | 
| 81 |  |  | { computed coefficeint } | 
| 82 |  |  | coef2 = A4/(A3+A4) * if(Dy, | 
| 83 |  |  | if(1-abs(sin_tB2o), | 
| 84 |  |  | dtrans(cos_tA2i, cos_tB2o), | 
| 85 |  |  | 0), | 
| 86 |  |  | if (Dy*cos_a2 + Dz*sin_a2, | 
| 87 |  |  | 0, | 
| 88 |  |  | if (1-abs(sin_tA2o), | 
| 89 |  |  | dtrans(cos_tB2i, cos_tA2o), | 
| 90 |  |  | 0))); | 
| 91 |  |  | { computed direction } | 
| 92 |  |  | dx2 = Dx; | 
| 93 |  |  | dy2 = if(Dy, | 
| 94 |  |  | (cos_a2*cos_tB2o-sin_a2*sin_tB2o)*cos_p, | 
| 95 |  |  | -cos_tA2o*cos_p); | 
| 96 |  |  | dz2 = if(Dy, | 
| 97 |  |  | (sin_a2*cos_tB2o+cos_a2*sin_tB2o)*cos_p, | 
| 98 |  |  | -sin_tA2o*cos_p); | 
| 99 |  |  | { incident angle (flat side) } | 
| 100 |  |  | sin_tA2i = Dz/cos_p; | 
| 101 |  |  | cos_tA2i = Sqrt(1-sin_tA2i*sin_tA2i); | 
| 102 |  |  | { transmitted angle (steep side) } | 
| 103 |  |  | sin_tB2o = stb(sin_tA2i, cos_a2, sin_a2); | 
| 104 |  |  | cos_tB2o = Sqrt(1-sin_tB2o*sin_tB2o); | 
| 105 |  |  | { incident angle (steep side) } | 
| 106 |  |  | sin_tB2i = -Dz/cos_p*cos_a2 - | 
| 107 |  |  | Sqrt(1-sq(Dz/cos_p))*sin_a2; | 
| 108 |  |  | cos_tB2i = Sqrt(1-sin_tB2i*sin_tB2i); | 
| 109 |  |  | { transmitted angle (flat side) } | 
| 110 |  |  | sin_tA2o = stb(sin_tB2i, cos_a2, -sin_a2); | 
| 111 |  |  | cos_tA2o = Sqrt(1-sin_tA2o*sin_tA2o); |