// // Use binary search to get the time of zenith angle 'angle' to the nearest minute // Inputs: t0=start of hour in which desired angle is // s=sign of "crossing direction": +1 means angle must be increasing, -1 decreasing // Output: t=desired time (average of t0, t1) t1=t0+3600 while(t1-t0>=60) { t=(t1-t0)/2+t0 // i e, (t0+t1)/2 SolarPosition(t,&az,&ze) if((s>0 && zeangle)) { t0=t } else { t1=t } } t=(t1-t0)/2+t0 // the best guess RETURN