function dy = retinapoints(t,y,FLAGS,log_polar,f,dmin_fovea,a,b,d)
%
%Instituto Superior Técnico - Instituto de Sistemas e Robótica - 			             09/2001
%OMNIVIEWS PROJECT    -   SVAVISCA sensor									[ccgd,jasv@isr.ist.utl.pt]
%
%function dy = retinapoints(t,y,FLAGS,log,f,d,a,b)
%
% This program computes the cross-section of a convex mirror for both
%	a log-polar sensor (svavisca) or a conventional camera. It is used by means
%	of the ode45 function to integrate the mirror profile.
%
% [T,Y] = ode45 ('retinapoints', t_min:dt:3, Y0, [], log_polar, f, d, a, b );
%  
% t_min [cm] - initial value of t : 0 for cartesian; 0.2073 for log-polar
% dt [cm]: integration step
% Yo [cm]: minimum distance from the mirror to the camera
%          Y0=15.5 for cartesian or Y0=21.5 for log-polar;
% log_polar = 1/0 : log polar / cartesian camera
% f [cm]- lens focal length in cm (2.5 for log-polar; 1.25 for cartesian)
% d [cm]- radius of the cilinder where the vertical resolution should be kept uniform (200cm)
% a - gain of the mirror (4 for log-polar; 2000 for cartesian)
% b [cm] - offset  (-400 for log-polar or cartesian)
% 

%Call init_sensor function to select the sensor
[h,d_floor,rho] = init_sensor(t,y,f,a,b,dmin_fovea,log_polar);

x= (t.*(d-t)+(y-f).*(y-h)) ./ ((y-f).*(d-t)-t.*(y-h));

dy = - x + sqrt(x.^2 + 1);
