%*********************************  s_range.m  ****************************
%function  R = s_range(BLNK, PL, BINSIZE, NBINS, Tx, Sal)

% Calculates the slant range for an ADCP for all the bins

function  R = s_range(BLNK, PL, BINSIZE, NBINS, Tx, Sal)

angle = 30*pi/180;

c = svel(Tx, Sal);

i = [0:NBINS-1]';

R = (ones(size(i))*(BLNK + abs((PL - BINSIZE)/2) + BINSIZE/4) + i*BINSIZE)/...
		cos(angle);
R = c*R/1475.1;
