Research Article

Hexahedral Localization (HL): A Three-Dimensional Hexahedron Localization Based on Mobile Beacons

Pseudocode 1

For i=1:number_of_node
Min_distance_anchor1_number(i)=max(all of the reference1 RSSI(i))
Min_distance_anchor2_number(i)=max(all of the reference2 RSSI(i))
Min_distance_anchor3_number(i)=max(all of the reference3 RSSI(i))
End % find out the 3 reference points nearest to the unknown nodes
For i=1:number_of_node
  M=[1 sqrt(3) 0;1 -sqrt(3) 0;0 0 1];
  N=[anchor1_x(min_distance_anchor1_number(i))+sqrt(3)anch
or1_y(min_distance_anchor1_number(i));anchor2_x(min_dista
nce_anchor2_number(i))- sqrt(3)  anchor2_y(min_distance_an
chor2_number(i));anchor3_z(min_distance_anchor3_number(i)
)];
C= ;
estimate_x(i)=C(1);
estimate_y(i)=C(2);
estimate_z(i)=C(3);
end
%calculate the position via the least square method