for this case solve for intersection point x_ip y_ip of a line containing edge i and a line perpendicular to edge i containing x_2_j y_2_j if vector type movement for polygon 2 a solution might not exist for this case solve for intersection point x_ip y_ip of a line containing edge i and a line parallel to the vector type movement containing x_2_j y_2_j if solution exits for x_ip y_ip get vector from vertex to intersection point x y x_ip u2212 x_2_j y_ip u2212 y_2_j if x y length minute if 2d type movement for polygon 2 find a point x y which meets the following requirements on right side of edge i ccw contained by a line perpendicular to edge i contained by a line also containing x_ip y_ip a minute distance from x_ip y_ip else vector type movement for polygon 2 find a point x y which meets the following requirements on right side of edge i ccw contained by a line parallel to the vector type movement contained by a line also containing x_ip y_ip a minute distance from x_ip y_ip because polygon may move several times keep the original location of the label if movement of x y leaves polygon with movement limit make vector just a bit larger that the distance to the edge so when polygon 2 is moved it moves just outside the polygon 1 length_of_xy length of x y 1 0 1 0e u2212 09 x x 1 0 10e u2212 09 y y 1 0 10e u2212 09 append length_of_xy to end of distance list append x y to end of vector list count_of_possible_vertices count_of_possible_vertices 1 next j if count_of_possible_vertices gt 0 find the.