function [imagePointWorld,intersectionImageGlass,vectorImageGlass,...
    intersectionImageWater,vectorImageWater,...
    intersectionLaserGlass,intersectionLaserWater,vectorLaserWater,...
    S,dmin]= Imagepoint_Laser_intersection_iterative(xpix,ypix,c,sensor,MCamera,...
    nAir,nGlass,nWater,zGlass,zWater,...
    positionLaser,omegaL,phiL,kappaL,fov,IOR)

X0 = MCamera(1:3,4);
% image coordinates from pixel to metric
[xBild,yBild]=pixel2metric(xpix, ypix,sensor(3),sensor(4),sensor(1)/sensor(3),IOR);

% image point in world coordinates
imagePointWorld = MCamera * [-xBild;-yBild;-c;1];
% Vector (image ray):
xvimageray = X0-imagePointWorld(1:3,:);

% Minterfaces parallel to xy
normalGlass = [0;0;1];
positionGlas = [0;0;zGlass];
normalWater = [0;0;1];
positionWater = [0;0;zWater];

%% Refraction Image Ray
% Interface Air Glass
[intersectionImageGlass,vectorImageGlass] = refraction(X0,xvimageray./norm(xvimageray),nAir,nGlass,positionGlas,normalGlass);
% Interface Glass Water
[intersectionImageWater,vectorImageWater] = refraction(intersectionImageGlass,vectorImageGlass,nGlass,nWater,positionWater,normalWater);


%% Intersect image ray with laser:
%% Laser
% rotation Laser:
RLaser = eul2rotm([kappaL,phiL,omegaL],'ZYX');

% field of view of laser 
fov1 = -fov/2;
fov2 = fov/2;
dmin = 100;
iteration = 0;
while dmin > 0.1
    iteration = iteration+1;
    % laser sheet is approximated with 3 sub-beams (left, right, center)
    fovVec = linspace(fov1,fov2,3);
    vectorLaserInput = [zeros(1,3);-tan(fovVec*pi/180);-ones(1,3)];
    vectorLaserNorm = [vectorLaserInput(1,:)./vecnorm(vectorLaserInput);...
        vectorLaserInput(2,:)./vecnorm(vectorLaserInput);...
        vectorLaserInput(3,:)./vecnorm(vectorLaserInput)];
    vectorLaserWorld = RLaser*vectorLaserNorm;
    
    % ntersection of sub-bemas with image ray
    for i = 1:3     % pro Sub-beam
        % refraction laser Air - glass
        [intersectionsLaserGlass(:,i),vectorsLaserGlass(:,i)] = refraction(positionLaser,vectorLaserWorld(:,i),nAir,nGlass,positionGlas,normalGlass);
        % refraction laser glass-water
        [intersectionsLaserWater(:,i),vektorsLaserWater(:,i)] = refraction(intersectionsLaserGlass(:,i),vectorsLaserGlass(:,i),nGlass,nWater,positionWater,normalWater);
        
        % intersection laser - image
        [distance(i),IntersectionsA(:,i),IntersectionsB(:,i)] = skewlineIntersection(intersectionImageWater,vectorImageWater,...
            intersectionsLaserWater(:,i),vektorsLaserWater(:,i));
        

    end
    
    % find sub-beam, with smallest distance to imageray
    [dmin,ind] = min(distance);

    % Define borders of new search window:
    fov1 = max(fovVec(ind)-(fovVec(3)-fovVec(2))/2,-fov/2);
    fov2 = min(fovVec(ind)+(fovVec(3)-fovVec(2))/2,fov/2);
    if iteration > 20
        break
    end
end

intersectionLaserGlass = intersectionsLaserGlass(:,i);
intersectionLaserWater = intersectionsLaserWater(:,i);
vectorLaserWater = vektorsLaserWater(:,i);

% Intersection point:
if iteration > 20
    S = [NaN,NaN,NaN];  % image ray does not intersect with laser sheet
else
    S = IntersectionsA(1:3,ind);
end
end

