def segments_colinear(ab, cd):
(a,b) = ab<EOL>(c,d) = cd<EOL>ss = [point_on_segment(ab, c), point_on_segment(ab, d),<EOL>point_on_segment(cd, a), point_on_segment(cd, b)]<EOL>return np.sum(ss, axis=<NUM_LIT:0>) > <NUM_LIT:1><EOL>
segments_colinear_2D((a, b), (c, d)) yields True if either a or b is on the line segment (c,d) or
if c or d is on the line segment (a,b) and the lines are colinear; otherwise yields False. All
of a, b, c, and d must be (x,y) coordinates or 2xN (x,y) coordinate matrices, or (x,y,z) or 3xN
matrices.