function humanoid = calccop(humanoid)

amplifier_factor=10;
react1 = humanoid.slave(1).sensor;
react2 = humanoid.slave(2).sensor;

    % Características do pé
        sensor_locx = humanoid.foot.sensor.locx;
        sensor_locy = humanoid.foot.sensor.locy;


    % Cálculo para o pé direito
        CoPx=0.0;
        CoPy=0.0;
        react = react1;
        if (sum(react)~=0)
            CoPx=sum(react.*sensor_locx)/sum(react)*amplifier_factor;
            CoPy=sum((react-50).*sensor_locy)/sum((react-50))*amplifier_factor;
        end

        humanoid.CoP.dir = [CoPx CoPy];


    % Cálculo para o pé esquerdo
        CoPx=0.0;
        CoPy=0.0;
        react = react2;
        if (sum(react)~=0)
            CoPx=sum(react.*sensor_locx)/sum(react)*amplifier_factor;
            CoPy=sum((react-50).*sensor_locy)/sum((react-50))*amplifier_factor;
        end

        humanoid.CoP.esq = [CoPx CoPy];