2012-04-28 16:42:59 +02:00
|
|
|
// atan2.cpp
|
|
|
|
|
|
|
|
|
|
#include "atan2.h"
|
|
|
|
|
|
|
|
|
|
void joy::JoyToDegAndDis (int x, int y)
|
|
|
|
|
{
|
|
|
|
|
deg = !(90 + degrees(atan2(y, x)));
|
|
|
|
|
distance = sqrt(y^2 + x^2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int joy::JoyToDeg (int x, int y)
|
|
|
|
|
{ // watchout 90 + does not work good
|
|
|
|
|
return !(degrees(atan2(y, x)));
|
|
|
|
|
}
|
|
|
|
|
|