#include <iostream>
#include <string>
#include <vector>
#include <math.h>
class Rotator {
public:
int c, d;
double e, f;
int p;
double r, l;
double A, B;
//상대좌표, 기준 객체 중심점을 0, 0이라 하고 클릭된 지점
void set(int c, int d, int x, int y){
this->c = c;
this->d = d;
r = root((double)(c*c + d*d));
double R = root(x*x + y*y);
e = x*r/R;
f = y*r/R;
l = root((c-e)*(c-e)+(d-f)*(d-f));
int k = d*e-c*f;
if(k > 0) p = 1;
else if(k == 0) p = 0;
else p = -1;
A = 1 - l*l/2/r/r;
B = p*l/r/r*root(r*r-l*l/4);
}
//inline
double root(double x){
//다른 라이브러리 참조를 래핑한 것
return sqrt(x);
}
void get(double a, double b, double& x, double& y){
x = A*a + B*b;
y = A*b - B*a;
}
};
int main()
{
Rotator test;
test.set(1, 0, 1, 1);
double a = -1, b = 1;
double x, y;
test.get(a, b, x, y);
//std::cout << x << " " << y << std::endl;
//std::cout << test.r;
}