Do These Two Routes Cross?
In short: two segments p1-p2 and p3-p4 cross if p1 and p2 fall on
opposite sides of the line through p3 and p4, AND p3 and p4 fall
on opposite sides of the line through p1 and p2. That's four calls to
last lesson's orientation and one comparison each way. The naive version of
that test has a gap: two segments that run along the same line and
overlap give every orientation a 0, which the naive test reads as "no
crossing" — wrong. Closing that gap needs one more check: when an
orientation comes back 0, look at whether the point actually falls inside
the other segment's span.

A clean X crossing
Two Meridian delivery routes are proposed, and the dispatcher wants to know if they cross before either driver sets off:
route_a's endpoints land on opposite sides of route_b's line, and
route_b's endpoints land on opposite sides of route_a's line too — both
conditions hold, so d1 != d2 and d3 != d4 is already True and the
function returns on the first check, with no collinear case needed at all.