% rotz_.m rotate about the Z axis function [xd, yd, zd] = rotz_(x, y, z, th) cosf = cos(th*pi/180); sinf = sin(th*pi/180); zd = z; xd = cosf.*x - sinf.*y; yd = sinf.*x + cosf.*y;