Skip to main content
. 2021 Mar 4;21(5):1772. doi: 10.3390/s21051772
Algorithm 1. Judgement Method of Square Symmetrical Environment
Input: A set of N points R={(ri,ϕi)|i=1,,N}
Output: Symmetrical environment or not
1: Convert raw data R to coordinate data P={(xi,yi)|i=1,,N}, ignore angle parameter
2: Calculate geometric centroid Pcentroid
3: Calculate new distance data R from P
4: Descending sort R as R
5: Count the number of maximum values nummax and number of minimum values nummin
6: If (nummax4||nummin4) then
7: Environment is not square symmetrical
8: End if, terminate
9: Calculate the Euclidean distance between two adjacent points d12, d23, d34, d41 in turn
10: If d12, d23, d34, d41 are not equal then
11: Environment is not square symmetrical
12: End if, terminate
13: Fit 4 lines by connecting adjacent two points in turn from 4 maximum distance points
14: Count the vertical distances from the remaining points to the 4 lines
15: If all distances less than ε which infinitely close to zero then
16: Environment is square symmetrical
17: Save the G‒V distance to the G‒V index list
18: else
19: Environment is not square symmetrical
20: End if, terminate