Skip to main content
. 2020 Jul 27;20(15):4171. doi: 10.3390/s20154171
Algorithm1 EEI (o1, o2, o3, o4)
  • 1.

     { 

  • 2.

      ρ: = (x(o1) − x(o2)) · (y(o3) − y(o4)) − (y(o1) − y(o2)) · (x(o3) − x(o4));

  • 3.

      if ρ = 0 then return 0;

  • 4.

      else

  • 5.

      {

  • 6. 

       κ1: = ((x(o1) − x(o3)) · (y(o3) − y(o4)) − (y(o1) − y(o3)) · (x(o3) − x(o4)))/ρ;

  • 7. 

       κ2: = − (((x(o1) − x(o2)) · (y(o1) − y(o3)) − (y(o1) − y(o2)) · (x(o1) − x(o3)))/ρ;

  • 8. 

       if (κ1 ≥ 0 and κ1 ≤ 1) and (κ2 ≥ 0 and κ2 ≤ 1) then return 1;

  • 9. 

       else return 0;

  • 10.

      }

  • 11.

     }