def cross_sign(vertex, edge, point): """ Compute the cross sign between the edge vector and (point - vertex) vector. """ cross_sign = sign(edge.cross(point - vertex)) if round(cross_sign, 7) == 0: # Point on edge return True else: return cross_sign < 0
def orientation_with(self, direction): # Fixme: check all cases # -> angle_with """ Return the angle of self on direction """ angle = math.acos(self.cos_with(direction)) angle_sign = sign(self.sin_with(direction)) return angle_sign * math.degrees(angle)