You could use Vector Math to discover the angles between them!
Here's a short answer:
ballToBrick = ballPosition - brickPosition;
ballToBrick.Normalize();
brickFacing = Vector2(0,1).Normalize();
float angle = acos( Dot(ballToBrick, brickFacing) );
The Brick facing is a tricky vector, it is the "start point" of the angle calculation. and if you want the vector to point up, make it (0, 1), point left (-1, 0), right (1, 0), point down(0, -1). Assuming you're in OpenGL axis, where up and right are positive.
If you dont know, here's the definitions of each function used:
Vector2.Normalize()
{
float length = squareroot(x * x + y * y);
x = x / length;
y = y / length;
return this;
}
Dot(Vector2 a, Vector2 b)
{
return a.x * b.x + a.y + b.y
}
Reference: http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-2/
EDIT:
For further answer you, this will give you the following:
0 Degrees: Straight up;
90 Degrees: Straight Right;
180 Degrees: Straight Down;
270 Degrees: Straight Left;
So lets test.
0 - 45 = 360 - 45 = 315
0 + 45 = 45
Between 315 and 360 we have up. Between 0 and 45 too.
90 - 45 = 45
90 + 45 = 135
Between 45 and 135 we have left.
180 - 45 = 135
180 + 45 = 225
Between 135 and 225 we have down.
270 - 45 = 225
270 + 45 = 315
Between 225 and 315 we have left.
That's it! Easy enough, you can just build yours 'ifs' now.