function [x, y] = polar2xy(r,theta)
% (x,y) are the Cartesian coordinates of polar coordinate r, theta.
% theta is in degrees.

rads= theta*pi/180; % radians
x= r*cos(rads);
y= r*sin(rads);