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

rads= d2r(theta);
x= r*cos(rads);
y= r*sin(rads);

function rad = d2r(deg)
% Convert from degrees to radians
rad = deg*pi/180;
