function index = RD_coords2index(x,y,n)
%

index = (y-1)*n + x;
