```c++
double PI=3.14;
int dir = atan2(delta_x, delta_y) * 180 / PI;
if(dir < 0) dir += 360;