#include <iostream>
#include <math.h>
#define M_PI 3.14159265358979323846
using namespace std;
double get_z_angle_for_point(double x, double y) {
double z = atan2(x, y) * -180.0 / M_PI + 360;
if (z >= 360.0)
z -= 360.0;
return z;
}
int main()
{
cout << get_z_angle_for_point(-1.0, 1.0) << endl <<
get_z_angle_for_point(-1.0, -1.0) << endl <<
get_z_angle_for_point(1.0, -1.0) << endl <<
get_z_angle_for_point(1.0, 1.0) << endl;
/*
equivalent to:
// 0604: get_Z_angle_for_point -1.0 1.0 store_to 0@ // 45
//0604: get_Z_angle_for_point -1.0 -1.0 store_to 0@ // 135
//0604: get_Z_angle_for_point 1.0 -1.0 store_to 0@ // 225
//0604: get_Z_angle_for_point 1.0 1.0 store_to 0@ // 315
*/
return 0;
}
Thank a lotthat's it sir
C++:#include <iostream> #include <math.h> #define M_PI 3.14159265358979323846 using namespace std; double get_z_angle_for_point(double x, double y) { double z = atan2(x, y) * -180.0 / M_PI + 360; if (z >= 360.0) z -= 360.0; return z; } int main() { cout << get_z_angle_for_point(-1.0, 1.0) << endl << get_z_angle_for_point(-1.0, -1.0) << endl << get_z_angle_for_point(1.0, -1.0) << endl << get_z_angle_for_point(1.0, 1.0) << endl; /* equivalent to: // 0604: get_Z_angle_for_point -1.0 1.0 store_to 0@ // 45 //0604: get_Z_angle_for_point -1.0 -1.0 store_to 0@ // 135 //0604: get_Z_angle_for_point 1.0 -1.0 store_to 0@ // 225 //0604: get_Z_angle_for_point 1.0 1.0 store_to 0@ // 315 */ return 0; }