function c = chat(r)

r = abs(r);
c = 1/2*acos(r)-1/2*r.*sqrt(1-r.^2);
c = c.*(abs(r)<1);