Skip to main content
. 2020 Mar 25;20(7):1831. doi: 10.3390/s20071831
Algorithm 2:
Input: The r1 derived by Algorithm 1, the length L of the ROI, and the height H of the ROI.
Output: The designated locations of nodes.
  • 1:

    r23r1; 2H3r1+1; n1Lr2+1; n22Lr22r2+2;

  • 2:

    fori=1 to 1 do   //row 1, row 2, , row (1)

  • 3:

        if (i is odd) then

  • 4:

            output the location (j·r2,3(i1)2r1) for each j=0 to n11;

  • 5:

        else   //i is even

  • 6:

            output the location (0,3(i1)2r1);   //location of the first node in this row

  • 7:

            output the location (2j+12r2,3(i1)2r1) for each j=0 to n22;

  • 8:

        end if

  • 9:

        output the location (L,3(i1)2r1);   //location of the last node in this row

  • 10:

    end for

  • 11:

    //row  (i.e., the last row)

  • 12:

    if ( is odd) then

  • 13:

        output the location (j·r2,H) for each j=0 to n11;

  • 14:

    else   // is even

  • 15:

        output the location (0,H);   //location of the first node in row 

  • 16:

        output the location (2j+12r2,H) for each j=0 to n22;

  • 17:

    end if

  • 18:

    output the location (L,H);   //location of the last node in row