Skip to main content
. 2018 Mar 17;18(3):895. doi: 10.3390/s18030895
Algorithm 3: CP Estimation on LOSL(i) based on the Intercept Theorem.
Initialization: Obtain the coordinates of all wireless sensor nodes, as well as the topology information of all LOSLs, that is, their formulas.
  • Step 1.

    Launch the algorithm when LOSL(i+1) is triggered;

  • Step 2.

    Successively check whether LOSL(in) is parallel with LOSL(i+1) in the reverse order, n[1, 2, ,i1];

    n=1;

    while (1)

      if LOSL(in) is parallel to LOSL(i+1)

        Obtain the elapsed time ratio R(i) according to Equation (14):

         R(i)=j=1nT(ij)/T(i);

      else

        Check next LOSL by: n=n+1;

      end

    end

  • Step 3.

    Retrieve the formula of LOSL(i+1), LOSL(i), LOSL(in), and obtain the intersections:

    M, (xM,yM) is the intersection of LOSL(i+1) and LOSL(i);

    N, (xN,yN) is the intersection of LOSL(in) and LOSL(i)

  • Step 4.

    Estimate the CP according to Equation (15):

    P=(N+MR)/(1+R).