Line Intersection

r'eic= a+ib/x+iy = (x-iy)(a+ib)/x2+y2
rsinc = bx-ay > 0
<=> 0 < c < 180
  • CounterClockWise
  • CCW(O,X,A)=
    +1 bx-ay > 0

    -1 bx-ay < 0

    -1 bx-ay = 0
    ax < 0 or by < 0

    0 x2+y2 a2+b2

    +1 else

    L1=(O,X) Segments L2=(A,B) L1L2ڣr
    <=> CCW(O,X,A) * CCW(O,X,B) 0 AND CCW(A,B,O) * CCW(A,B,X) 0

    CCW(O,X,A) = 0                                               CCW(O,X,A) = -1