--- ray/src/cv/lampcolor.c 1991/09/05 15:09:08 1.2 +++ ray/src/cv/lampcolor.c 1991/09/12 13:26:16 1.5 @@ -49,7 +49,7 @@ or \"ring\". These may be abbreviated as a single let { "total lamp lumens", "0", outpcheck, "This is the overall light output of the lamp and its fixture. If you do\n\ not know this value explicitly, you can compute the approximate lumens\n\ -by multiplying the input wattage by 15 for incandescent fixtures or 40\n\ +by multiplying the input wattage by 14 for incandescent fixtures or 70\n\ for fluorescent fixtures." }, }; @@ -198,53 +198,45 @@ double *dp; getpolygon() /* get projected area for a polygon */ { - printf("Enter area of polygon: "); - if (!getd(&projarea)) - return(0); - projarea *= unit2meter*unit2meter; - projarea *= PI; + static double area = 1.0; + + printf("Polygon area [%g]: ", area); + getd(&area); + projarea = PI*unit2meter*unit2meter * area; return(1); } getsphere() /* get projected area for a sphere */ { - double radius; + static double radius = 1.0; - printf("Enter sphere radius: "); - if (!getd(&radius)) - return(0); - radius *= unit2meter; - projarea = 4.*PI*PI*radius*radius; + printf("Sphere radius [%g]: ", radius); + getd(&radius); + projarea = 4.*PI*PI*unit2meter*unit2meter * radius*radius; return(1); } getcylinder() /* get projected area for a cylinder */ { - double length, radius; + static double length = 1.0, radius = 0.1; - printf("Enter cylinder length: "); - if (!getd(&length)) - return(0); - length *= unit2meter; - printf("Enter cylinder radius: "); - if (!getd(&radius)) - return(0); - radius *= unit2meter; - projarea = PI*PI*2.*PI*radius*length; + printf("Cylinder length [%g]: ", length); + getd(&length); + printf("Cylinder radius [%g]: ", radius); + getd(&radius); + projarea = PI*PI*2.*PI*unit2meter*unit2meter * radius*length; return(1); } getring() /* get projected area for a ring */ { - double radius; + static double radius = 1.0; - printf("Enter disk radius: "); - if (!getd(&radius)) - return(0); - radius *= unit2meter; - projarea = PI*PI*radius*radius; + printf("Disk radius [%g]: ", radius); + getd(&radius); + projarea = PI*PI*unit2meter*unit2meter * radius*radius; return(1); }