void radianDir(short int *deltaX, short int *deltaY, float **radiansImg, int xdirtag, int ydirtag) { // int pos; float *dirim; double dx, dy; dirim = (float *) calloc(HEIGHT*WIDTH, sizeof (float)); *radiansImg = dirim; for (int i = 0, pos = 0; i < HEIGHT; i++) { for (int j = 0; j < WIDTH; j++, pos++) { dx = (double) deltaX[pos]; dy = (double) deltaY[pos]; if (xdirtag == 1) dx = -dx; if (ydirtag == -1) dy = -dy; dirim[pos] = (float) angleRad(dx, dy); } } }
float Vector2::angleRad(Vector2 * other) { return angleRad(other->getX(), other->getY()); }
float Vector2::angleRad(cocos2d::Vec2 other) { return angleRad(other.x, other.y); }