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

Comparing ray/src/cv/mgflib/vect.c (file contents):
Revision 1.1 by greg, Thu Feb 8 11:08:05 1996 UTC vs.
Revision 1.2 by gregl, Fri Jan 16 10:47:27 1998 UTC

# Line 9 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9   #ifndef M_PI
10   #define M_PI    3.14159265358979323846
11   #endif
12 + #define PI      ((double)M_PI)
13  
14   #define EPSILON 1e-6
15  
# Line 132 | Line 133 | float vect_angle (Vector v1, Vector v2)
133          else if (cos_theta >= +1.0)
134              angle = 0.0;
135          else
136 <            angle = (180.0/M_PI) * acos(cos_theta);
136 >            angle = (180.0/PI) * acos(cos_theta);
137      }
138  
139      return angle;
# Line 162 | Line 163 | void vect_rotate (Vector v1, Vector v2, int axis, floa
163   {
164      float  cosa, sina;
165  
166 <    cosa = cos ((M_PI/180.0) * angle);
167 <    sina = sin ((M_PI/180.0) * angle);
166 >    cosa = cos ((PI/180.0) * angle);
167 >    sina = sin ((PI/180.0) * angle);
168  
169      switch (axis) {
170          case X:
# Line 193 | Line 194 | void vect_axis_rotate (Vector v1, Vector v2, Vector ax
194      float  cosa, sina;
195      Matrix mat;
196  
197 <    cosa = cos ((M_PI/180.0) * angle);
198 <    sina = sin ((M_PI/180.0) * angle);
197 >    cosa = cos ((PI/180.0) * angle);
198 >    sina = sin ((PI/180.0) * angle);
199  
200      mat[0][0] = (axis[X] * axis[X]) + ((1.0 - (axis[X] * axis[X]))*cosa);
201      mat[0][1] = (axis[X] * axis[Y] * (1.0 - cosa)) - (axis[Z] * sina);
# Line 260 | Line 261 | void mat_rotate (Matrix mat1, Matrix mat2, int axis, f
261      Matrix mat;
262      float  cosa, sina;
263  
264 <    cosa = cos ((M_PI/180.0) * angle);
265 <    sina = sin ((M_PI/180.0) * angle);
264 >    cosa = cos ((PI/180.0) * angle);
265 >    sina = sin ((PI/180.0) * angle);
266  
267      mat_identity (mat);
268  
# Line 297 | Line 298 | void mat_axis_rotate (Matrix mat1, Matrix mat2, Vector
298      float  cosa, sina;
299      Matrix mat;
300  
301 <    cosa = cos ((M_PI/180.0) * angle);
302 <    sina = sin ((M_PI/180.0) * angle);
301 >    cosa = cos ((PI/180.0) * angle);
302 >    sina = sin ((PI/180.0) * angle);
303  
304      mat[0][0] = (axis[X] * axis[X]) + ((1.0 - (axis[X] * axis[X]))*cosa);
305      mat[0][1] = (axis[X] * axis[Y] * (1.0 - cosa)) - (axis[Z] * sina);
# Line 422 | Line 423 | void mat_decode (Matrix mat, Vector scale,  Vector she
423      }
424  
425      /* Convert the rotations to degrees */
426 <    rotate[X] = (180.0/M_PI)*rotate[X];
427 <    rotate[Y] = (180.0/M_PI)*rotate[Y];
428 <    rotate[Z] = (180.0/M_PI)*rotate[Z];
426 >    rotate[X] = (180.0/PI)*rotate[X];
427 >    rotate[Y] = (180.0/PI)*rotate[Y];
428 >    rotate[Z] = (180.0/PI)*rotate[Z];
429   }
430  
431  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines