function [x,y]=CoordTrans(teta1,teta2,L1,L2) x=L1*cos(teta1)+L2*cos(teta1+teta2); y=L1*sin(teta1)+L2*sin(teta1+teta2);