Determine moving direction based on touch location
===

I am trying to figure out the best way to determine which direction to move based on the users touch on the screen. So say i get a 2d position 23x and 320y i need to then return one of the following LEFT,RIGHT,UP,DOWN.

Currently the code i am using isn't very reliable and i am wondering if someone can advise me on a better way of doing it.

Thanks

    if (at_position.x <= width*2/3 && at_position.x >= width*1/3 && at_position.y <= this->screenHeight*2/3)
    {
        return UP;
                
    }
    else if (at_position.x <= width*2/3 && at_position.x >= width*1/3 && at_position.y >= this->screenHeight*1/3)
    {
        return DOWN;      
    }
    else if (at_position.x <= this->screenWidth*2/3 && at_position.y >= this->screenHeight*1/3 && at_position.y <= this->screenHeight*2/3)
    {
       return LEFT;         
    }
    else if (at_position.x <= this->screenWidth*1/3 && at_position.y >= this->screenHeight*1/3 && at_position.y <= this->screenHeight*2/3)
    {
       return RIGHT;        
    }
