几何体的arctan(x/y)
假设一个平面中一个正方形,坐标点第一象限(500,500),角度45度;第二象限(-500,500),角度135度;第三象限点(-500.-500),角度225度;第四象限点(500,-500),角度315度;
double PI=3.1415926;
cin>>xx>>yy;
double A;
if (xx > 0 && yy > 0) //第一象限
A = atan(xx / yy);
else if (xx < 0 && yy>0) //第二象限
A = PI / 2 - atan(xx / yy);
else if (xx < 0 && yy < 0) //第三象限
A = PI + (PI / 2 - atan(xx / yy));
else if (xx > 0 && yy < 0) //第四象限
A = 1.5 * PI - atan(xx / yy);
cout<<"角度:"<<A*180/PI;