Decomposition of Polygon Boundaries

To morph one polygon into another, the boundaries of considered polygons are decomposed into four corresponding parts to obtain a more natural interpolation of the transformation that avoids significant turns and rotations of the boundary during interpolation. For this purpose, four sets of vertices with minimal and maximal abscissas and with minimal and maximal ordinates have to be found for the current and for the forecasted polygon. These sets can contain more than one point, and some sets can coincide. If the considered set consists of more than one point, the simplest solution is to take the first point from each set of vertices in the vertex index increase direction. Another option is to choose a point from this set, which provides balanced length for the boundary parts. Boundary parts obtained in this manner are illustrated in Figure 3. Here, *Pol<sup>t</sup>* and *Polt*+Δ*<sup>t</sup>* are polygons at time moments *t* and *t* + Δ*t*, respectively. The points *E<sup>t</sup> i* , *i* = 1, ... , 8 and *Et*+Δ*<sup>t</sup> <sup>j</sup>* , *<sup>j</sup>* <sup>=</sup> 1, ... , 9 are the vertices and *<sup>E</sup>*∗*Top* , *E*∗*Right* , *E*∗*Bottom* , *E*∗*Lef t* are subsets of vertices with minimal or maximal first or second coordinates of the polygons *Pol<sup>t</sup>* and *Polt*+Δ*<sup>t</sup>* .

**Figure 3.** Decomposition of boundaries into four parts (marked by different colors) for the actual polygon *Polt* and the next (forecasted) one *Pol<sup>t</sup>* <sup>+</sup> <sup>Δ</sup>*<sup>t</sup>* .

After boundary decomposition, morphing of the boundary parts is performed through the linear interpolation of the vertices in *s* discrete time steps of the duration <sup>Δ</sup>*<sup>t</sup> <sup>s</sup>* . To perform the interpolation, the boundary parts are balanced in order to establish one-toone correspondence between them. This means that the boundary part with the smallest number of vertices receives additional points uniformly distributed along the edges so that, on each edge, the quotient number of additional points plus one additional point on the remaining number of edges in the vertex index increase direction is selected. The described approach is illustrated in Figure 4. Here, the piecewise linear curve *A*1*A*<sup>3</sup> is transformed into the piecewise linear curve *B*1*B*10. The quotient of the division of ten by three is equal to three and the remainder is equal to one. Therefore, the edge *A*1*A*<sup>2</sup> gets three plus one additional points, and three additional equidistant points are selected on the *A*2*A*<sup>3</sup> edge. They are marked red in Figure 4.
