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.2 by greg, Thu Sep 5 15:09:08 1991 UTC vs.
Revision 1.5 by greg, Thu Sep 12 13:26:16 1991 UTC

# Line 49 | Line 49 | or \"ring\".  These may be abbreviated as a single let
49          { "total lamp lumens", "0", outpcheck,
50   "This is the overall light output of the lamp and its fixture.  If you do\n\
51   not know this value explicitly, you can compute the approximate lumens\n\
52 < by multiplying the input wattage by 15 for incandescent fixtures or 40\n\
52 > by multiplying the input wattage by 14 for incandescent fixtures or 70\n\
53   for fluorescent fixtures." },
54   };
55  
# Line 198 | Line 198 | double *dp;
198  
199   getpolygon()                    /* get projected area for a polygon */
200   {
201 <        printf("Enter area of polygon: ");
202 <        if (!getd(&projarea))
203 <                return(0);
204 <        projarea *= unit2meter*unit2meter;
205 <        projarea *= PI;
201 >        static double   area = 1.0;
202 >
203 >        printf("Polygon area [%g]: ", area);
204 >        getd(&area);
205 >        projarea = PI*unit2meter*unit2meter * area;
206          return(1);
207   }
208  
209  
210   getsphere()                     /* get projected area for a sphere */
211   {
212 <        double  radius;
212 >        static double   radius = 1.0;
213  
214 <        printf("Enter sphere radius: ");
215 <        if (!getd(&radius))
216 <                return(0);
217 <        radius *= unit2meter;
218 <        projarea = 4.*PI*PI*radius*radius;
214 >        printf("Sphere radius [%g]: ", radius);
215 >        getd(&radius);
216 >        projarea = 4.*PI*PI*unit2meter*unit2meter * radius*radius;
217          return(1);
218   }
219  
220  
221   getcylinder()                   /* get projected area for a cylinder */
222   {
223 <        double  length, radius;
223 >        static double   length = 1.0, radius = 0.1;
224  
225 <        printf("Enter cylinder length: ");
226 <        if (!getd(&length))
227 <                return(0);
228 <        length *= unit2meter;
229 <        printf("Enter cylinder radius: ");
232 <        if (!getd(&radius))
233 <                return(0);
234 <        radius *= unit2meter;
235 <        projarea = PI*PI*2.*PI*radius*length;
225 >        printf("Cylinder length [%g]: ", length);
226 >        getd(&length);
227 >        printf("Cylinder radius [%g]: ", radius);
228 >        getd(&radius);
229 >        projarea = PI*PI*2.*PI*unit2meter*unit2meter * radius*length;
230          return(1);
231   }
232  
233  
234   getring()                       /* get projected area for a ring */
235   {
236 <        double  radius;
236 >        static double   radius = 1.0;
237  
238 <        printf("Enter disk radius: ");
239 <        if (!getd(&radius))
240 <                return(0);
247 <        radius *= unit2meter;
248 <        projarea = PI*PI*radius*radius;
238 >        printf("Disk radius [%g]: ", radius);
239 >        getd(&radius);
240 >        projarea = PI*PI*unit2meter*unit2meter * radius*radius;
241          return(1);
242   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines