function rovnice=rce(fi)
global DH T16 i
T1=Tfiz(fi(1))*Tz(DH(1,1))*Tx(DH(1,2))*Tfix(DH(1,3));
T2=Tfiz(fi(2))*Tz(DH(2,1))*Tx(DH(2,2))*Tfix(DH(2,3));
T3=Tfiz(fi(3))*Tz(DH(3,1))*Tx(DH(3,2))*Tfix(DH(3,3));
T4=Tfiz(fi(4))*Tz(DH(4,1))*Tx(DH(4,2))*Tfix(DH(4,3));
T5=Tfiz(fi(5))*Tz(DH(5,1))*Tx(DH(5,2))*Tfix(DH(5,3));
T6=Tfiz(fi(6))*Tz(DH(6,1))*Tx(DH(6,2))*Tfix(DH(6,3));
T16s=T1*T2*T3*T4*T5*T6;
r1=T16s(1,4)-T16(1,4,i);
r2=T16s(2,4)-T16(2,4,i);
r3=T16s(3,4)-T16(3,4,i);
r4=T16s(1,1)-T16(1,1,i);
r5=T16s(2,2)-T16(2,2,i);
r6=T16s(3,3)-T16(3,3,i);
r7=T16s(1,2)-T16(1,2,i);
r8=T16s(1,3)-T16(1,3,i);
r9=T16s(2,3)-T16(2,3,i);
rovnice=[r1;r2;r3;r4;r5;r6;r7;r8;r9];