In the simulations, a ray going vertically upwards from the point is assumed
although the theorem does not impose any restrictions on the direction of the ray. Then,
the ray is tested against each edge of the region by checking whether:
1. The point in the half-plane is below the extended edge
2. The point's X coordinate is within the edge's X-range
Handling of points on the edges will be tricky since the solution may turn out to be
incorrect. In any case, the number of points exactly on any one of the edges will be very
few and the algorithm works well in spite of these points.
3.3.2 Results
Spreading in a star shaped region is considered here. The parameters used in the
above simulation are in table 3.3. The result is shown in figure 3.11. As seen in this
figure, the robots initially spread in a circular fashion and as they reach the boundary, few
of them start moving towards the narrow edges. One can see that the formation gets well
defined as the edges are reached gradually.
Table 3.3 Parameters used in the spreading algorithm for star shaped region
Parameter Value
Number of robots 100
Number of iterations 100
Time step 0.03 s
Velocity of the robots 1 m/s
Figure 3.12 illustrates the application of spreading algorithm for various shapes. It
can be inferred that as the edges becomes narrow, the robots struggle to reach the edges
and hence the distribution is not completely uniform in those regions as compared to