function [outx,outy]=rotm(theta,x,y)

%function [outx,outy]=rot(theta,x,y)

%

% This function does a rotation of coordinate axis

% according to the formula

% x'=xcos(t)+ysin(t) and y'=-xsin(t)+ycos(t)

% where the prime denotes the new coordinates

%

% Expects "theta" in degree clockwise

% as in the old "REDUCE" program 

% and converts to radians counterclockwise

% to be compatible with the standard formula

theta=theta*(-1.);

theta=(theta/180.)*pi;

outx=x.*(ones(size(x))*cos(theta))+y.*(ones(size(y))*sin(theta));

outy=(-1.)*x.*(ones(size(x))*sin(theta))+y.*(ones(size(y))*cos(theta));