double testx, testy, testdeg, testrad, endx, endy;
testx = 1;
testy = 1;
testdeg = atan2( testx, testy) / Math::PI* 180;
testrad = sqrt(pow(testx,2) + pow(testy,2));
endx = testrad * cos(testdeg);
endy = testrad * sin(testdeg);
All parts of this seem to equate properly, except endx and endy should = testx and testy they do when calculating by hand.