#include #include #include #define TRUE 1 #define FALSE 0 #define MYFILE "reflect.in" #define HITS_MAX 10 #define SPHERES_MAX 25 typedef struct { double x,y; } VECTOR; typedef struct { int x,y,r; } SPHERE; typedef struct { double x,y,dx,dy; } RAY; int main() { FILE* fin = fopen(MYFILE, "r"); int n, inf; SPHERE spheres[SPHERES_MAX]; RAY ray, newray; int hits[HITS_MAX+1]; double A,B,C,D,lambda,newlambda; double norme, wt, wn; VECTOR delta, vN, vT; int i,j,k,bcount,icount; fscanf(fin, "%d", &n); icount = 0; while(n>0) { icount++; for(i=0; i0 && (newlambda = -(B+sqrt(D))/A)>0 && (newlambda=0 && bcount=0) { if(i