| 344 | | box(0,0,z_c,yheight/2,yheight/2,zdepth); |
| | 343 | box(0,0,z_c,xwidth,yheight,zdepth); |
| | 344 | |
| | 345 | /*draw individiual lenses*/ |
| | 346 | /*draw a circle at the maximal aperture and a parabola along x and y*/ |
| | 347 | int i,j=0; |
| | 348 | printf("%g %g\n",N,(N<20?N:20)); |
| | 349 | for (j=0;j<(N<20?N:20);j++){ |
| | 350 | circle("xy",0,0,-w+j*(d+2*w),yheight/2.0); |
| | 351 | circle("xy",0,0,d+w+j*(d+2*w),yheight/2.0); |
| | 352 | double zz0,zz1,yy0,yy1,dz,s; |
| | 353 | yy0=yheight/2.0; |
| | 354 | zz0=zz1=-w; |
| | 355 | dz=w/(64.0-1.0); |
| | 356 | s=j*(d+2*w); |
| | 357 | printf("%d %g\n",j,s); |
| | 358 | /*first parabola*/ |
| | 359 | while(zz1<=0){ |
| | 360 | zz1+=dz; |
| | 361 | yy1=sqrt(2*r*fabs(zz1)); |
| | 362 | line(0,yy0,s+zz0,0,yy1,s+zz1); |
| | 363 | line(0,-yy0,s+zz0,0,-yy1,s+zz1); |
| | 364 | line(yy0,0,s+zz0,yy1,0,s+zz1); |
| | 365 | line(-yy0,0,s+zz0,-yy1,0,s+zz1); |
| | 366 | zz0=zz1;yy0=yy1; |
| | 367 | } |
| | 368 | zz0=0;zz1=0;yy0=0; |
| | 369 | /*2nd parabola*/ |
| | 370 | while(zz1<=w){ |
| | 371 | zz1+=dz; |
| | 372 | yy1=sqrt(2*r*fabs(zz1)); |
| | 373 | line(0,yy0,d+s+zz0,0,yy1,d+s+zz1); |
| | 374 | line(0,-yy0,d+s+zz0,0,-yy1,d+s+zz1); |
| | 375 | line(yy0,0,d+s+zz0,yy1,0,d+s+zz1); |
| | 376 | line(-yy0,0,d+s+zz0,-yy1,0,d+s+zz1); |
| | 377 | zz0=zz1;yy0=yy1; |
| | 378 | } |
| | 379 | } |