Skip to main content
. 2023 Jan 14;23(2):973. doi: 10.3390/s23020973
Algorithm 2 Setup-Hit-Triangles
1: Cn Combination of triangles by G mode, index:i={0,1, , N1}
2: L   Listener

3: S   Sound source
4: PC PathCacheBuffer of S
5: Td Triangle, depth:d = {0,1,2,3}
6: TP(Td) Type of Td= {Reflection, Diffraction, None}
7: procedure Setup-hit-triangles (Cn, L, S)
8:  Cn Merge sort combinations in Cn and combinations in PC
9:  for C{C0,Cn1} do
10:   for T{T0,T3} do
11:    TP(Td)GetTypeOfTriangle(Td, S) 
12:    if TP(Td) is a reflection type then
13:     Calculate image mirror positions based on Td and L
14:     T update the image mirror positions
15:    else if TP(Td) is a diffraction type then
16:     Calculate edge information based on Td, S, and L
17:     T update edge information

18:    else // None
19:     continue
20:    end if
21:   end for
22:  end for
23: end procedure