ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/disk2square.c
(Generate patch)

Comparing ray/src/common/disk2square.c (file contents):
Revision 3.1 by greg, Fri Feb 18 00:40:25 2011 UTC vs.
Revision 3.4 by greg, Thu Oct 23 18:19:14 2014 UTC

# Line 1 | Line 1
1 + #ifndef lint
2 + static const char RCSid[] = "$Id$";
3 + #endif
4   /*
5   *  Disk2Square.c
6   *  
# Line 8 | Line 11
11   * Modified interface slightly (G. Ward)
12   */
13  
14 + #define _USE_MATH_DEFINES
15   #include <math.h>
16  
17   /*
# Line 66 | Line 70 | SDsquare2disk(double ds[2], double seedx, double seedy
70                  phi = 0.;
71         }
72     }
73 <
73 >   r *= 0.9999999999999;        /* prophylactic against MS sin()/cos() impl. */
74     ds[0] = r * cos(phi);
75     ds[1] = r * sin(phi);
76  
# Line 98 | Line 102 | SDdisk2square(double sq[2], double diskx, double disky
102          a = -(phi - 3*M_PI/2) * b / (M_PI/4);
103      }
104  
105 <    sq[0] = (a + 1) * 0.5;
106 <    sq[1] = (b + 1) * 0.5;
105 >    sq[0] = a*(0.5/0.9999999999999) + 0.5;
106 >    sq[1] = b*(0.5/0.9999999999999) + 0.5;
107   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines