% MATLAB script for checking angle of rotation in 2D

phi = rand(1,1)*pi; % Angle of rotation
c = cos(phi); s = sind(phi);
x = rand(2,1); x = x/norm(x); % normalized random vector for tesing

D = [c -s;s c]; % rotation matrix
disp(['cos(angle of rotation) = ' num2str(cos(phi))]);
disp(['<D x,x> = ' num2str(dot(D*x,x))]);

