
 
returns LARGER iff the signed distance of p and l is larger than the signed distance of q and l, SMALLER, iff it is smaller, and EQUAL iff both are equal.  

 
returns LARGER iff the signed distance of r and l is larger than the signed distance of s and l, SMALLER, iff it is smaller, and EQUAL iff both are equal, where l is the directed line through p and q. 