#include #include #ifndef M_PI #define M_PI 3.14159265358979323846 #endif using namespace std; int main(int argc, char* argv[]) { float xpos = -1300.0f; float ypos = -1300.0f; float xbpos = -1301.0f; float ybpos = -1302.0f; float dx = xpos - xbpos; float dy = ypos - ybpos; float ang = atan2(dy, dx); ang = (ang >= 0) ? ang : 2 * M_PI + ang; cout << "Angle:" << ang << endl; cout << "Sin: " << sin(ang) << endl; cout << "Cos: " << cos(ang) << endl; }