You can determine North, South, East and West from the azimuth (not the angle) of the line segment, you just have to define what constitutes North South East and West. I would suggest anything lying between
45 degrees and 135 degrees would be East
135 degrees and 225 degrees would be South
225 degrees and 315 degrees would be West
anything else would be North
You'll need to get your >=, >, <= and < correct though