function [uP, vP, wP] = Bousquet1(NK,XsiK,ItaK,XsiI,ItaI,ZtaI)

    global pi2; global pi4;

    vKsiJ = 0;
    vItaJ = 0;
    vZtaJ = 0;
    PhiJ = 0;

    SignBRK = 1;
    for k = 1:NK

        L = k + 1;
        if L > NK;
            L = 1;
        end

        dK = sqrt((XsiK(L) - XsiK(k)) ^ 2 + (ItaK(L) - ItaK(k)) ^ 2);
        rK = sqrt((XsiI - XsiK(k)) ^ 2 + (ItaI - ItaK(k)) ^ 2 + ZtaI ^ 2);
        rL = sqrt((XsiI - XsiK(L)) ^ 2 + (ItaI - ItaK(L)) ^ 2 + ZtaI ^ 2);

        LK = (XsiK(k) - XsiI) * (XsiK(L) - XsiK(k));
        LK = (LK + (ItaK(k) - ItaI) * (ItaK(L) - ItaK(k))) / dK;

        mK = (XsiK(L) - XsiI) * (XsiK(L) - XsiK(k));
        mK = (mK + (ItaK(L) - ItaI) * (ItaK(L) - ItaK(k))) / dK;
        
        bRK = (XsiI - XsiK(k)) * (ItaK(L) - ItaK(k));
        bRK = (bRK - (ItaI - ItaK(k)) * (XsiK(L) - XsiK(k))) / dK;
        Qk = log((rK + rL + dK) / (rK + rL - dK));
        denom = (rK * rL * bRK ^ 2 + ZtaI ^ 2 * LK * mK);
        if denom == 0
            JK = 0;
        else
            TanJK = bRK * (abs(ZtaI) * (rK * mK - rL * LK)) / denom;
            JK = atan(TanJK);
            if TanJK < 0
                JK = JK + pi;
            end
        end

        if bRK < 0
            SignBRK = -1;
            JK = JK - pi;
        end
        if bRK == 0
            JK = JK + pi;
        end
            
        vKsiJ = vKsiJ - (ItaK(L) - ItaK(k)) * Qk / dK;
        vItaJ = vItaJ + (XsiK(L) - XsiK(k)) * Qk / dK;
        vZtaJ = vZtaJ + JK;
        PhiJ = PhiJ + bRK * Qk + abs(ZtaI) * JK;

    end

    dTeta = 0;
    if SignBRK > 0
        dTeta = pi2;
    end
    
    uP = vKsiJ / pi4;
    vP = vItaJ / pi4;
    SignZeta = 1;
    if ZtaI < 0
        SignZeta = -1;
    end
    wP = SignZeta * (dTeta - vZtaJ) / pi4;