function dy = foveapoints(t,y,FLAGS,log_polar,f,dmin_fovea,a,b,ipheight)
%     
%Instituto Superior Técnico - Instituto de Sistemas e Robótica - 			             09/2001
%OMNIVIEWS PROJECT    -   SVAVISCA sensor									[ccgd,jasv@isr.ist.utl.pt]
%
%function dy = foveapoints(t,y,FLAGS,log_polar,f,dmin_fovea,a,b,ipheight)
%
% This program computes mirror points for fovea mirror
%
% t [cm] - distance vector in the horizontal coordinate for the mirror
% Yo [cm]: minimum distance from the mirror to the camera, Fo = (t*f)/rho;
% 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
% b [cm] - offset  (set by minimum angle for the retina mirror)
% dmin_fovea - minimum distance in the floor covered by the minimum angle of the fovea
% ipheight [cm]- image plane height: height between the floor and image plane


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

den = ( (y+ipheight).*t + (t-d_floor).*(y-f) ); 
if den == 0
   dy = 0;
else
	x = (t.*(d_floor-t)+ (y + ipheight).*(y-f)) ./ den;
   dy = x +  sqrt(x.^2 + 1);
end; 

