'Test whether the point `other` lies in the positive span of `self`.
A point x is \'in front\' of a point y if x.dot(y) >= 0.  Return
-1 if `other` is behind `self.p1`, 0 if `other` is `self.p1` and
and 1 if `other` is in front of `self.p1`.'

def _span_test(self, other):

    if (self.p1 == other):
        return 0
    rel_pos = (other - self.p1)
    d = self.direction
    if (d.dot(rel_pos) > 0):
        return 1
    return (-1)
