function [X,Y,Z]=pantilt(radius,pan,tilt)
i=1;
for v=tilt
    for u=pan
        X(2,i)=radius*cos(v)*cos(u);
        Y(2,i)=radius*cos(v)*sin(u);
        Z(2,i)=radius*sin(v);
        X(1,i)=X(2,i);
        Y(1,i)=Y(2,i);
        Z(1,i)=Z(2,i);
        i=i+1;
    end
end
size(X)
size(Y)
size(Z)
end