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

Comparing ray/src/cv/lampcolor.c (file contents):
Revision 1.6 by greg, Thu Sep 12 13:36:43 1991 UTC vs.
Revision 1.7 by greg, Tue Oct 22 09:38:17 1991 UTC

# Line 27 | Line 27 | int    typecheck(), unitcheck(), geomcheck(), outpcheck()
27  
28   float   *lampcolor;             /* the lamp color (RGB) */
29   double  unit2meter;             /* conversion from units to meters */
30 < double  projarea;               /* projected area for this geometry */
30 > double  area;                   /* radiating area for this geometry */
31   double  lumens;                 /* total lamp lumens */
32  
33   struct {
# Line 173 | Line 173 | compute()                      /* compute lamp radiance */
173   {
174          double  whiteval;
175  
176 <        whiteval = lumens/470./projarea;
176 >        whiteval = lumens/470./PI/area;
177  
178          printf("Lamp color (RGB) = %f %f %f\n",
179                          lampcolor[0]*whiteval,
# Line 209 | Line 209 | getpolygon()                   /* get projected area for a polygon */
209  
210          getd("Polygon area", &area,
211                  "Enter the total radiating area of the polygon.");
212 <        projarea = PI*unit2meter*unit2meter * area;
212 >        area = unit2meter*unit2meter * area;
213          return(1);
214   }
215  
# Line 220 | Line 220 | getsphere()                    /* get projected area for a sphere */
220  
221          getd("Sphere radius", &radius,
222                  "Enter the distance from the sphere's center to its surface.");
223 <        projarea = 4.*PI*PI*unit2meter*unit2meter * radius*radius;
223 >        area = 4.*PI*unit2meter*unit2meter * radius*radius;
224          return(1);
225   }
226  
# Line 233 | Line 233 | getcylinder()                  /* get projected area for a cylinder *
233                  "Enter the length of the cylinder.");
234          getd("Cylinder radius", &radius,
235                  "Enter the distance from the cylinder's axis to its surface.");
236 <        projarea = PI*PI*2.*PI*unit2meter*unit2meter * radius*length;
236 >        area = 2.*PI*unit2meter*unit2meter * radius*length;
237          return(1);
238   }
239  
# Line 245 | Line 245 | getring()                      /* get projected area for a ring */
245          getd("Disk radius", &radius,
246   "Enter the distance from the ring's center to its outer edge.\n\
247   The inner radius must be zero.");
248 <        projarea = PI*PI*unit2meter*unit2meter * radius*radius;
248 >        area = PI*unit2meter*unit2meter * radius*radius;
249          return(1);
250   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines