Skip to main content
. 2018 Mar 28;18(4):1009. doi: 10.3390/s18041009
Algorithm 1 Searching the congruent tetrahedron
Input: Ts={s0,s1,s2,s3}: four vertexes of Ts; HT: hash table
Output: Tm={m0,m1,m2,m3}: four vertexes of Tm
  • 1:

    L0−1=∥s0−s1∥2, k0−1=H(L0−1) ▹Li−j, ki−j: length between si and sj, and bucket number

  • 2:

    search the point pair (m0,m1) in the k0−1th bucket;

  • 3:

    L0−2=∥s0−s2∥2, L1−2=∥s1−s2∥2, k0−2=H(L0−2), k1−2=H(L1−2)

  • 4:

    search the point pair (m0,m2) in k0−2th bucket, and (m1,m2) in k1−2th bucket

  • 5:

    if there is no point m2 was found in step 4 then

  • 6:

      goto step 2 to find another pair

  • 7:

    end if

  • 8:

    L0−3=∥s0−s3∥2, L1−3=∥s1−s3∥2, L2−3=∥s2−s3∥2, k0−3=H(L0−3), k1−3=H(L1−3), k2−3=H(L2−3)

  • 9:

    search the point pair (m0,m3) in k0−3th bucket, the point pair (m1,m3) in k1−3th bucket, and (m2,m3) in k2−3th bucket

  • 10:

    if there is no point m3 was found in step 9 then

  • 11:

      goto step 4 to find another pair

  • 12:

    else

  • 13:

      return the four points m0, m1, m2 and m3

  • 14:

    end if