⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 21s17 days 22 hours 20 minutes 21 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 21s17 days 22 hours 20 minutes 21 seconds.

Sign in to watch this lesson
Advanced - Geometry · 4:04
A segment PQ spans the line Ax + By + C = 0 with A = Py - Qy, B = Qx - Px and C = -A·Px - B·Py; dividing by the gcd and fixing the sign makes equal lines give equal triples. Two lines meet by Cramer's rule, whose denominator is zero exactly for parallel lines. Two segments intersect when both pairs of orientation signs disagree (a zero counts as touching), and when all four signs are zero the segments are collinear and the overlap of their projections decides; finding the intersection then yields empty, a point or a segment, with __int128 for the large intermediate values.