function R = rot_y(w) % function R = rot_y(w) % Prepares rotation matrix for a rotation of the x,y,z % axes about the y-axis. The object stays fixed. % See gg303 lab 6 % Input parameters % w = rotation angle (in degrees) % Output parameters % R = rotation matrix % Example % R = rot_y(30) % X_prime = R*[0;0;1] cosw = cos(deg2rad(w)); sinw = sin(deg2rad(w)); R = zeros(3,3); R(1,1) = cosw; R(1,2) = 0; R(1,3) = -sinw; R(2,1) = 0; R(2,2) = 1; R(2,3) = 0; R(3,1) = sinw; R(3,2) = 0; R(3,3) = cosw;