Manuscript Offprint
arXiv:2611.08556The Containment Polytope of a Triangle and a Convex Polygon
Abstract
The containment polytope for a triangle and a convex -gon is a four-dimensional polytope representing the similarity transforms (translation, rotation, scaling) that place inside . While it is known that the complexity of and its silhouette , which represents all the largest placements of inside for all orientations, can be quadratic in , we show that the silhouette can be partitioned into a linear number of planar convex chains and steps in time.
Based on the linear number of convex chains and steps, we can compute the complexity of silhouette in time and query the largest placement of inside for a given orientation in time. We explain geometrically how the triangle rotates while continuously scaling and translating to be maximal inside , leading to a parameterized algorithm for containment problems.
1 Introduction
For a convex -gon and a convex -gon in the plane, it is a natural question to ask (1) whether can be placed inside allowing translation and rotation, or, more generally, (2) what is the largest similar copy of that can be placed inside allowing translation and rotation.
In 1983, Chazelle [5] gave an -time algorithm for the first question. When is an equilateral triangle or a square, DePano, Ke and O'Rourke [6] gave an -time algorithm for the second question. When is a general triangle, Sharir and Toledo [9] used parametric search to obtain an algorithm for the second question with running time .
In 1998, Agarwal, Amenta and Sharir [1] gave an -time algorithm to compute the set of all possible placements of inside under translation, rotation, and scaling. They followed Baird [3], to represent all similarity transforms (that is, combinations of scaling, rotation, and translation) by quadruples such that represent scaling and rotation , while represents the translation. For , the corresponding similarity transform is the affine map . They define the set as the set of all similarity transforms such that .
We have if and only if all vertices of lie inside all the halfplanes that define the convex polygon . For vertex of and halfplane of , we have if and only if
which is a linear inequality in the four variables . It follows that the set is the four-dimensional convex polytope obtained as the intersection of half-spaces. We call the con-tainment polytope of and . The authors of [1] show that the complexity of the containment polytope is .
If we project onto the -plane, we obtain a two-dimensional convex polygon . Scaling and rotation are the polar coordinates of this plane, which means that can be scaled by and rotated by and placed in if and only if .
For an angle , let us define as rotated counter-clockwise by angle around the origin. We next define as the largest scaling factor such that can be placed inside . From the above, it follows that the boundary of is a representation of the function . The maximum is necessarily attained at a vertex of . The authors of [1] show how to compute the vertices of , and therefore of , in time, thus solving problem (2). They also construct convex polygons and such that the containment polytope has complexity.
This lower bound was strengthened by the authors of [2], who, for every and construct convex polygons and such that the projection has complexity . For , can even be chosen as the equilateral triangle. This implies that the function does have complexity . Various authors [5, 7, 1, 2] have taken this as an indication that solving problem (2) will require time , even in the case of triangular .
Nevertheless, in 2024, Chan and Hair [4] achieved a break-through: they presented an -time algorithm for problem (2) when is a triangle, making use of parametric search and divide-and-conquer to avoid having to look at all vertices of . They extend this to an -time algorithm (for any ) when is a convex -gon
In some situations one is actually interested in other aspects of the function . The interest of [2] was to answer a question paused by Pál [8] in his work on Kakeya's problem: given two convex shapes (not necessarily polygons) and and knowing that for every , can be placed in , is it then true that can be rotated through inside ? The paper shows that this is indeed true, and proves the following theorem (which for the polygonal case easily follows from the description using the containment polytope ):
Theorem 1 ([2]). For any convex shapes and , there exists a continuous function such that .
We can now formulate a third problem on the convex polygons and : (3) find the largest scaling of such that can be rotated through inside . Solving this problem requires finding the minimum of .
The function corresponds to the silhouette of the containment polytope , that is, those edges of that project onto the edges of . The silhouette forms a closed loop in .
In this paper, we will study the geometry of the triangle as rotates through , in other words, as we trace the silhouette (see Figure 1).
Throughout the paper, we will assume that the containment polytope is in general position. Specifically we require that it has no vertical faces, and that its defining hyperplanes are in general position: no three hyperplanes intersect in a plane, no four in a line, and no five in a point. The first condition ensures that the silhouette is indeed a closed polygonal chain consisting of edges (and does not include two-dimensional faces). This condition holds when has no parallel edges. The second condition ensures that at every placement of the triangle on an edge of , we have exactly three incidences between vertices of and edges of , and at every vertex of , we have exactly four such incidences. Geometrically, this assumption means that there is no scaled placement of in with all vertices on the boundary of and two vertices on vertices of .

Figure 1: The triangles as we rotate through .
Without these two assumptions, our proofs would need additional technical complications that we currently do not know how to handle.
To avoid confusion between the vertices and edges of and on one side and of on the other side, we will call the edges of the silhouette steps, and the vertices of pivots. We will also call the vertices of corners to avoid confusion with the vertices of .
For an angle , let be the unique largest placement of in , that is , and let be the vertices , respectively, of .
A perfect rotation from to is the set . A perfect rotation corresponds to a subpath of the silhouette . We naturally extend this notation to open and half-open intervals, , , , by excluding the corresponding endpoints. We call (the entire silhouette) the global perfect rotation. Throughout the paper, if we say rotates, this means that undergoes an perfect rotation inside in counter-clockwise direction.
For a given pivot , we define the next pivot of as the smallest pivot strictly larger than . Then, the perfect rotation corresponds to a step of .
We start by showing that along a single step of , the triangle performs a perfect rotation with center (See Figures 2 and 3 for illustrations).
Theorem 2. Let be a triangle and a convex polygon in general position, and consider a single step of the silhouette . While the triangle moves along this step, it performs a perfect rotation around a center (which can lie outside of ), scaling around to remain in contact with the same edges of .
On a single step of , the same three corner-edge incidences between and hold. This means that either all three corners of lie (in the relative interior) of the same three edges of , or one corner is fixed at a vertex of , one other corner moves in (the relative interior) of an edge of , and the third corner moves along a line in the interior of .

Figure 2: The perfect rotation when the center lies inside Q.

Figure 3: The perfect rotation when the center lies outside Q.
When all three corners move on edges of , then either all three corners move counter-clockwise along (Figure 2), or one moves clockwise while the other two move counter-clockwise (Figure 3). The two cases depend on the center of perfect rotation in Theorem 2 lying inside or not. We will say that a corner moves forward if it moves counter-clockwise or is stationary, backward if it moves clockwise.
We can therefore classify the steps of into ten different types: let be the type of step . Then, is
-
type when all three corners of lie on and move forward during the step;
-
type when corner moves backward during the step;
-
type when corner is at a vertex of , corner moves on an edge of , and corner lies in the interior of during the step;
-
type when corner is at a vertex of , corner moves on an edge of , and corner lies in the interior of during the step;
-
and types are defined analogously.
We will see that the type of a step depends entirely on the angles formed by the lines supporting the edges of involved in the step's corner-edge incidences.
We then study in detail what happens at a pivot, that is, when we move from one step of the silhouette to the next. At a pivot, we add an additional corner-edge incidence to the three incidences from the previous step, and then go on to the next step where one of the original three incidences no longer holds. This means that at a pivot, we have four corner-edge incidences, so at least one corner must coincide with a vertex of . We distinguish 2-pivots, where two corners lie at vertices of (the third corner is then necessarily in the interior of ), and 3-pivots, where only one corner lies at a vertex, while the other two corners lie in the relative interior of edges of .
In Section 4 we study in detail how the type of the step before and the step after the pivot relate.
Theorem 3. Let be a triangle and a convex polygon in general position, and consider the pivot between steps and of the silhouette . Figure 4 shows the pairs of types and that can occur, with the color of the arrow indicating which corner of changes its corner-edge incidence.
We next define a chain to be a sequence of steps such that all pivots of the chain are 3-pivots and such that on all steps of the chain the same two corners of lie on the same two edges of . This immediately implies that these steps form a convex chain of inside a two-dimensional plane of .
Our main theorem states that there is a decomposition of the silhouette into a linear number of chains and a linear number of single steps.
Theorem 4. Let be a triangle and a convex polygon in general position. Then the silhouette of can be decomposed into chains and single steps. This subdivision can be computed in time.
To prove the Theorem 4, we define a stride which consists of constant number of chains and steps, and partition the global perfect rotation into linear number of strides in Section 6. The proof relies heavily on the diagram of Figure 4.

Figure 4: Possible pairs of types, with arrows from to .
Since we obtain a linear number of strides that cover the global perfect rotation sorted in counter-clockwise order with respect to the angle, the chains and steps from Theorem 4 are also sorted in counter-clockwise order. Then, for a given angle , we can find which chain or step contains in time using binary search, in other words, we can find the three corner-edge incidences of . Based on this fact, we compute the placement of in time.
Additionally, for each chain and step, the number of pivots contained within them can be computed in time. Thus, the complexity of silhouette can be computed in time. Since we will present that each step can be computed in time, we obtain an -time algorithm to solve the problem (2) and (3) where k is the complexity of silhouette .
Let be the boundary of and for any two distinct points , let denote the restricted boundary of from to in the counter-clockwise direction, including both endpoints. We naturally extend this notation to open and half-open intervals, , , , by excluding the corresponding endpoints.
For two points and , let denote the euclidean distance of line segment .
For two vectors , , let denote the counterclockwise angle from vector to vector . For two integers , let and for three points in the plane, let . For simplicity, let be the angles , respectively, and let for each .
For two triangles and , if two triangles are similar each other, we denote . Let be the area of triangle .

Figure 5: The center of perfect rotation
2 The rotation center for a triangle inside a triangle
Key to proving Theorem 2 is an understanding of how a triangle rotates inside another triangle.
Definition 5. The center of perfect rotation of with respect to is the point which satisfies:
-
Let be the perpendicular feet from point to lines , respectively. Then, .
-
The point lies in the circumcircle of .
The triangle obtained by projecting a point on the sides of a triangle is called the pedal triangle. The definition states that is the center of perfect rotation if its pedal triangle is similar to .
We call the point the center of perfect rotation because of the following: Let be an inscribed triangle of that is similar to and where the three vertices lie on the three edges , respectively. Unless one vertex of coincides with a vertex of , we can slightly rotate around the center and scale it from until its vertices lie on the three edges again. This way we obtain another triangle that is inscribed to and that is again similar to (the three triangles are similar to each other, see Figure 5).
When is an equilateral triangle, the point is a well-known triangle-center, the first isodynamic point, the intersection of the three Apollonius circles of . For general , the following lemma guarantees the existence and uniqueness of the center of perfect rotation and shows how to find it.
Lemma 6. Given two triangles and , there exists a unique center of perfect rotation of with respect to . This center can be computed in constant time.
Proof. Let be the angles , respectively.
We first assume that all three are smaller than . Since , at least two of three angles are not smaller than . Without loss of generality, let . Then, the set of points which satisfy is an arc with center , and the set of points which satisfy is an arc with center .
We claim that two arcs and intersect only at point which is the center of perfect rotation of with respect to . By the definitions of arc and center , the angle can be computed as follows:
and, cyclically, we have . With these two angles, the angle can be computed as follows:
which is smaller than . This implies that two arcs and intersect once at point which is point mirrored by line . We also observe that the angle is smaller than , so that the point lies in the interior of , which also means, lies in the circumcircle of .
Let be the perpendicular feet from point to lines . Since the four points and four points are concyclic, we have and . Then, the angle can be computed as follows:
and cyclically, we have and . Therefore, is similar to which implies that the point is the center of perfect rotation.
We next assume that one of three is larger than . Since , at least one of three is smaller than . Without loss of generality, let . Then, the set of points which satisfy is an arc with center , and the set of points which satisfy is an arc with center .
We again claim that two arcs and intersect only at point . By the definitions of two arcs and two centers , we have and . Since is larger than , we also obtain , in other words, . And the circle containing the arc passes through the vertex , whereas the disk containing the arc on its boundary does not contain the vertex because . Thus, by these two observations, two arcs and must intersect only at point which lies in the exterior of .
Since the sum of two angles is larger than , the point lies in the circumcircle of . And, by applying the equation (1) cyclically, we have and . Therefore, is similar to which implies the point is the center of perfect rotation.
The remaining case is one of three equals ; without loss of generality, let . Then, we always can find the point on the line segment such that . Let be the perpendicular feet from point to lines , . By the concyclicity of four points , we have and . Thus, if we consider the point as the perpendicular feet from to line , then is similar to . Since the point also lies in the circumcircle of (lies on ), the point is the center of perfect rotation.
So far, we prove that the center of perfect rotation of with respect to always exists and also show that how to compute it with two arcs in constant time. We will finish the proof by showing that the center of perfect rotation p is unique.
Let be the circumcircle of the four points and define the two circumcircles and , cyclically. Since the line segments are the diameters of circles , respectively, by the sine law,
The set of points which satisfy is a circle and cyclically, we obtain the two circles and . There are two intersections and of the three circles , which are inverse to each other with respect to the circumcircle of (the proof is analogous to establishing the inverse relationship between the first and second isodynamic points with respect to the circumcircle). Therefore, the center of perfect rotation is unique.
Lemma 6 also implies that the point is the center of perfect rotation of with respect to if and only if . Based on this fact, we prove the following lemma.
Lemma 7 (Trilinear Coordinates). For a center of perfect rotation of with respect to , let be the directed distance from to such that when lies on the same side of line from the interior of and when lies on the opposite side of line from the interior of , and we define , cyclically. Then,
Proof. By the definition, we can compute the area of in two different ways as follows:
Since the center lies on the opposite side of line from the interior of when , the directed distance can be expressed as:
Then, by the equation (2) from the proof of Lemma 6 and the sine law, the ratio
proving the lemma.
In the following section, we will prove Theorem 2 with Lemma 6 and present how to decide the type of step with Lemma 7.
3 Perfect rotation along a step of
By Theorem 1, the three vertices move continuously during the global perfect rotation . For every , we define the triplet as follows: is the index of the edge of that lies on. If corner coincides with vertex of , then (rather than ). If lies in the interior of , then is the index of the last edge that corner lies on, in other words, the edge that corner departs from . If corner moves forward and passes through the vertex , we will say, rather than 1. We define and analogously.
The triplet remains constant along a step of the silhouette , since the halfspaces defining the containment polytope are exactly the incidences between corners of and edges of . Thus, for a given pivot and the next pivot of , the triple can differ from in only one position. With this definition of , we prove Theorem 2.
Proof of Theorem 2. We observe a perfect rotation from a step and by the definition, there is no pivot in the interval .
We first consider the case when a corner of lies in the interior of Q, for instance, corner lies in the interior of Q during the step. Since there are three vertex-edge incidences during the perfect rotation , we have or .
Without loss of generality we assume , which implies that the angles and are positive (see Figure 6). Under these assumptions, as rotates, the corner remains fixed at , the corner moves along the edge in counter-clockwise direction and the corner moves in the interior of . Symmetrically, if the corner lies in the interior of , the corner moves along the edge in counter-clockwise direction and the corner moves inside the interior of . Therefore, if a vertex of lies in the interior of during the perfect rotation, one vertex of , which is the center , remains fixed at a vertex of and the other vertex of moves in counter-clockwise direction along .
We now assume that all three corners of lie on and for . Then, we construct by extending the three edges and find the center of rotation of with respect to (see Figure 2 and Figure 3). By Lemma 6, rotates during the step with the center of perfect rotation .

Figure 6: Perfect rotations when a vertex of lies in the interior of Q.
We define the moving distance as the distance from to along in counterclockwise direction. By definition, the moving distance is negative when moves backwards. We make analogous definitions for and , and have the following lemma.
Corollary 8. If for some angle ,
In particular, for a given 3-pivot , we can compute the next pivot of in constant time.
Proof. For and with , let be the center . If are perpendicular feet from to lines , respectively, all are similar to each other and all are similar to each other. Then, all are similar to each other with scaling ratio from Lemma 7.
To denote the angles formed by the lines supporting the edges of containing the vertices of , we introduce , with and defined cyclically.
Corollary 8 implies that if all three angles are smaller than , then all corners of move forward, as the center of inscribed rotation lies in the interior of .
If one of the three angles equals , let's say, , then corner remains fixed and two corners move forward (the center coincides with corner ). If one of the three angles is larger than , let's say, , then corner moves backward (the center lies outside of ). Since , only one corner of can be fixed or move backward.
Therefore, if all three corners of lie on then the moving directions and relative speeds of are determined only by the three angles and . In other words, the moving directions and relative speeds of three corners of are invariant in the interior of every step of .
In summary, for a given step , we can decide the type of step by computing three angles , , as follows: for ,
-
: all three angles , , are not larger than .
-
: when .
-
: when .
-
: when .
and types can be found analogously. Based on this fact, we prove the following corollary.
Corollary 9. For two angles and such that and four corners appears in counter-clockwise order along . Then, if two corners appears in counter-clockwise (resp. clockwise) order along , then the angle is not larger (resp. larger) than .
Proof. Construct the triangle by extending three lines . Since , corner moves forward or backward along the boundary of this triangle, depending on the order of and . Thus, we can decide whether is larger than or not.
4 What happens at a pivot of
Consider a perfect rotation from a point on one step of to a point on the next step. In other words, there is exactly one pivot with . Suppose that the type of step changes from to at pivot . Then, by discussing the possible pairs of states that can occur, we prove the Theorem 3 (see Figure 10, Figure 11, and Figure 12 at the end of paper).
Proof of Theorem 3. Suppose that . Then we enumerate all possible types depending on the type .
• When , without loss of generality, assume that coincides with . Then and .
-
If , then since moves backward.
-
If , then since .
Thus, we have two possible pairs or , the pairs , , , for the symmetric cases, and the trivial pair .
• When ,
-
if coincides with and , then since .
-
if coincides with and , then since .
-
if coincides with the vertex of Q and
-
if , then since moves forward.
-
if , then since moves backward.
-
if , then since .
Here, we have six possible pairs , , , , and .
• When ,
-
if coincides with and , then .
-
if reaches on the edge , then . And
-
if , then since moves forward.
-
if , then since moves backward.
-
if , then since .
We have five possible pairs , , , and .
• When ,
-
if coincides with and , then .
-
if reaches on the edge , then .
-
if , then since moves backward.
-
if , then since .
We have four possible pairs , , and .
The possible pairs where is one of the six types follow by symmetry. Figure 4 shows the state diagram, with all possible transitions indicated by arrows. Additionally, two pairs can be obtained by following and .
To summarize, when arrives at a pivot , one of the three angles increases, another one decreases, and the last one remains unchanged. If one of the three angles becomes negative, the type of step becomes one of the six types . If one of the three angles crosses the value , then the type of step can become one of the four types .
We next observe that some specific pivots restrict the placement of as stated in the following Corollary 10 and Lemma 11.
Corollary 10. For two consecutive pivots and where the type of the step is or , there exists no orientation such that the four corners , , , and appear in a counterclockwise order along with .
Lemma 11. For two consecutive 3-pivots and where the type of step is , there exists no orientation such that both corners and of lie on or .
Proof. Suppose for contradiction that there exists an orientation where both corners and lie on . If the four corners , and appear in a counter-clockwise order along , then can be enlarged, which contradicts the definition of . Thus, the relative order of the inner two corners must be reversed, meaning that the four corners , and appear in a counterclockwise order along .

Figure 7: Instances of Corollary 10 and Lemma 11.
We now consider the set of all possible placements of corner such that there exists a triangle where and two vertices lie on the two line segments , respectively. Then, this set will be the parallelogram which satisfies and . By the similarity of triangles, we obtain and (see Figure 7).
From , we obtain (1) when , and (2) when . Since four corners appear in a counterclockwise order along , by the convexity of , (1) when and (2) when . In either case, we have .
The inequality with respect to can be computed as follows:
With the equation , this inequality implies that the corner must lie in the interior of . Since both corners and lie on , by Corollary 10, the placement of cannot lie on the type or step, in other words, the corner must lie on . Therefore, the existence of orientation contradicts the definition of . The same argument applies to the 3-pivot by replacing with .
5 Steps and strides
Our goal is to partition the global perfect rotation into a linear number of perfect rotations, each called stride. To introduce this specific perfect rotation, we define the next head pivot as follows:
Definition 12. For a given pivot , the next head pivot of is the smallest pivot strictly larger than that satisfies one of the followings:
• is a 2-pivot,
• differs from in at least two elements.
Beyond the definition of step, we define an extended step using the next head pivot of .
Definition 13. A stride is a perfect rotation where is a pivot and is the next head pivot of .
In other words, a stride is a sequence of steps of such that all internal pivots of the stride are 3-pivots, and the triples of the steps vary only in one position. While taking steps within a stride, one element of will change first and only this position can be updated during the stride up to the next head pivot .
The triple can change on every step of a stride, and the type of step can change as well. To denote the types of steps within a single stride, we define the type of the perfect rotation consist of multiple steps as the sequence of types that appear on its steps:
Definition 14. For and a perfect rotation with two pivots and , if there exist pivots such that and the type of step changes from to a different type at each pivot for , then the type of the perfect rotation is the string of types .
Since only one element of can change during a stride, the number of all possible types of stride is relatively small. Thus, we will enumerate all possible types of stride, which will lead us to a key property of the stride. Before discussing the types of strides, we first prove the following lemma about a perfect rotation with specific type patterns.
Lemma 15. For a perfect rotation with two 3-pivots and , if the type of the perfect rotation is a string of combination of type and type , then . In particular, if the perfect rotation satisfies one of the followings:
-
is a step,
-
the first step of is of type , or the last step of is of type ,
-
the type of step changes from to at the pivot ,
then, we obtain .
Proof. Since the pivot is 3-pivot, the type of step changes either (1) from or to , or (2) from or to at the pivot . Symmetrically, since is also a 3-pivot, the type of step changes either (1) from to , , or , or (2) from to or at the pivot . All internal pivots of the perfect rotation are 2-pivots, where the type of step changes either from to , or from to .
If is a step, we have or . Since two pivots and are 3-pivots, corner departs from at edge and returns to again at edge during its counter-clockwise motion. Then, the angle if , and the angle if . In both cases, we obtain .
We now assume that consists of multiple steps and let and be the first and last step of , respectively.
When , we have . If , corner returns to which implies that . Otherwise, which also implies that since . However, if , we obtain since and is convex. This contradicts ; thus, .

Figure 8: The type and steps from pivot .
When or the type of step changes from to at the pivot , we have . If , corner departs from , which implies that . Otherwise, the type of step changes from or to , which also implies that . However, if , we obtain since and is convex. This contradicts ; thus, .
The remaining types of the perfect rotation are strictly alternating sequences of and of even length, i.e. .
Let be the smallest 2-pivot strictly larger than such that the type of step changes from to , and let and . Then the corner will move along the restricted boundary rotated clockwise by and scaled by around . Let be the vertices of this transformed boundary in the counter-clockwise order, where each corresponds to for . By the definition, the angle and if , the angle for .
Let be the smallest 2-pivot strictly larger than such that the type of step changes from to or the corner returns to and let (possibly ). Then the corner will move along the restricted boundary rotated counter-clockwise by and scaled by around . Let , be the vertices of this transformed boundary in the counter-clockwise order, where and each corresponds to for (possibly ). By the definition, if , the angle for and if , the angle (see Figure 8).
With these assumptions, for , we can compute the angle as follows:
This implies that the vertices lie on the right open half-plane with respect to .
Suppose that the line intersects at and , where is closer to than to . Clearly, cannot lie on . Thus, if the corner returns to , the corner must lie on and therefore, .
Otherwise, the corner lies in the interior of . If we define , , , in the same way, the point cannot lie on since , . So, if the corner returns to , we obtain , again. Therefore, by repeating this process until the corner returns to , we always have .
Lemma 15 remains valid when are cyclically rotated. With Definition 14 and Lemma 15, we have the following important lemma.
Lemma 16. A stride contains at most five different types of steps and after passing through a stride, at least one element of increases.
Proof. For a given pivot , let and be the next pivot and next head pivot of , respectively. If is 2-pivot, by the definition, we have . Then the chain is a step of with one of six types . Thus, after passing through this step, one element of increases by one.
Suppose that is 3-pivot. Depending on the type of the first step , we enumerate all possible types of strides and compare with .
- When , the first two pivots and are 3-pivots. Without loss of generality, we assume that increases by one at the pivot , which implies that only can vary throughout the perfect rotation . Then we can find all possible by taking red-colored arrows from state and a blue-colored arrow from to from Figure 4.
(a) : the last step of stride is of type ; the stride terminates when either the corner coincides with vertex or the corner coincides with vertex . Thus, (1) and (2) either or .
(b) : there exists a 3-pivot such that the type of step changes from to . Then, the corner coincides with the vertex .
The last step of stride is of type ; either the corner returns to or the corner coincides with vertex at the 2-pivot . Since all corners of move forward during the perfect rotation , it follows that (1) and (2) either by Lemma 15, or .
(c) When there exists a 3-pivot such that the type of step changes from to . Then, the corner coincides with the vertex .
i. : the last step of stride is of type ; either (1) the corner coincides with the vertex or (2) the corner coincides with a vertex of Q and . In either case, we obtain since corner always moves forward throughout the stride.
ii. : there exists another 3-pivot such that the type of step changes from to . Then, the corner coincides with the vertex . The last step of stride is of type ; either the corner returns to or the corner coincides with vertex at the 2-pivot . Thus, it follows that
(i) since the corner always moves forward during the perfect rotation and (ii) either by Lemma 15, or .
iii. : there exists another 3-pivot such that the type of step changes from to . This happens when corner moves backward along the edge , and corner coincides with the vertex .
The last step of stride is of type ; either the corner coincides with the vertex at the 2-pivot or the corner returns to . In either case, we have since the corner always moves forward throughout the stride.
Let be a set of strings and define two sets and , cyclically. Then, all possible types when and is updated first at the next pivot can be expressed as the concatenation for each .
In general, let be the set of all possible types when . Then, we can express the set .
- When , corner returns to at the 3-pivot and by Lemma 15. Since only can change throughout the stride, we can find all by taking green-clored arrows from state and a red-colored arrow from to from Figure 4.
(a) : Assume that the type of step changes from to at 3-pivot .
The last step of stride is of type ; either the corner coincides with the vertex at 2-pivot or the corner returns to . In either case, we have .
(b) : assume that the type of step changes from to at 3-pivot .
The last step of stride is of type ; either (1) the corner or coincides with a vertex of and or (2) the corner coincides with vertex . In either case, we have since corner moves forward during the perfect rotation .
Let be the set of all possible types when . Then, we can express the set .
- When , corner returns to at the 3-pivot and by Lemma 15.
(a) : assume that the type of step changes from to at 3-pivot .
If , either the corner returns to or the corner coincides with the vertex at the 2-pivot . Thus, and . Otherwise, , which reduces to the situation when ; thus, and .
(b) : assume that the type of step changes from to at 3-pivot .
If , the case reduces to the situation when and is updated first. Otherwise, , the case reduces to the situation when . By the observation of , at least one element of increases.
(c) Assume that the type of step changes from to at 3-pivot . Then, we obtain by Lemma 15 and only can change throughout the stride.
i. : the last step of stride is of type ; either (1) the corner coincides with the vertex or (2) the corner coincides with a vertex of Q and . In either case, we have since corner moves forward during the perfect rotation .
ii. : there exists another 3-pivot such that the type of step changes from to .
The last step of stride is of type ; either the corner returns to or the corner coincides with the vertex at the 2-pivot . Thus, it follows that (i) and (ii) either by Lemma 15, or .
iii. : there exists another 3-pivot such that the type of step changes from to .
The last step of stride is of type ; either the corner returns to or the corner coincides with the vertex at the 2-pivot . In either case, we have since corner moves forward during the perfect rotation .
In short, we have where .
Let be the set of all possible types when . Then, we can express the set , where .
- When , two pivots and are 3-pivots. Depending on the first updated element of , we can find all possible types of chain by following specific colored arrows and a red-colored arrow from to and green-colored arrow from to from Figure 4.
(a) : by the definition of the next head pivot , the stride will be finished when two elements of change. Thus, either or since two corners move forward throughout the stride.
(b) : there exists a 3-pivot such that the type of step changes from to . Then, the corner coincides with vertex and since corner moves forward during the perfect rotation .
The last step of stride is of type ; the corner coincides with the vertex at 2-pivot or the corner returns to . Thus, we have (i) and (ii) either or by Lemma 15.
(c) Assume that there exists a 3-pivot such that the type of step changes from to .
i. : the last step of stride is of type ; if , the corner coincides with the vertex at the 2-pivot . Otherwise, , the corner also can return to . Thus, we have either or by Lemma 15.
ii. : there exists another 3-pivot such that the type of step changes from to . Then, the case reduces to the situation 3-(c) when . By the observation of 3-(c), at least one element of increases.
iii. : there exists another 3-pivot such that the type of step changes from to . Then, the corner returns to and by Lemma 15.
The last step of stride is of type ; the corner returns to or the corner coincides with the vertex at 2-pivot . In either case, we have since corner moves forward during the perfect rotation .
iv. : there exists another 3-pivot such that the type of step changes from to . Then, the corner returns to and by Lemma 15. This means that the case reduces to the situation when and is updated first. By the observation of , at least one element of increases.
(d) : assume that there exists a 3-pivot such that the type of step changes from to . Then, which reduces to the situation when and is updated first. By the observation of , at least one element of increases.
(e) : assume that there exists a 3-pivot such that the type of step changes from to . Then, which reduces to the situation 3-(c) when . By the observation of 3-(c), at least one element of increases.
Let be the set of all possible types when . Then, we can express the set , where .
The remaining , , , , , can be obtained by permuting , cyclically. Since the length of string is at most five, a stride contains at most five different types of steps and we have shown that at least one element of increases after passing the stride.
Based on the fact that a stride has at most five types of steps, we can compute a stride using only binary search as follows:
Lemma 17. Given a pivot , the stride starting at can be computed in time.
Proof. Let and be the next pivot and the next head pivot of pivot , respectively, and let and . Then, if , we define as the smallest pivot such that the type of step changes from to other type at pivot . We claim that we can compute the perfect rotation and decide the type in time if it exists.
We compute the type by computing .

Figure 9: The parallelogram in Lemma 17.
- When (when are symmetric): corner is fixed at vertex and corner moves along edge in counter-clockwise direction. Thus, we compute the edge rotated clockwise direction by and scaled by from and then, find the intersection between this edge and using binary search.
If there exists an intersection point, this point will be a vertex and a vertex will be so that we can compute the placement of . By computing three angles , we can decide the type .
Otherwise, there is no intersection point which means that corner coincides with vertex at 2-pivot , in other words, .
- When : we first take a step from the 3-pivot and find which element of is updated first at the 3-pivot . Without loss of generality, we assume that is updated first. Then, the type of step can change from to or , we have three following cases:
- If pivot does not exist, that is , all three corners of moves forward during the stride and either the vertex or coincides with the vertex or .
To find the next head pivot , we construct the parallelogram which is the set of all possible placements of vertex such that there exists where and two vertices lie on two edges , respectively (as we previously showed in Lemma 11). Then, for a point , there exist two vertices where and two vertices lie on two edges , respectively. In particular, if vertex lies on the boundary of , then either vertex or vertex coincides with a vertex of (see Figure 9).
Thus, we can find the vertex from the intersection between the boundary of and using a binary search (if the intersection is not unique, we must pick the point that is the closest to vertex along ). Two vertices or can also be found from the relative placement of with respect to ; thus, the next head pivot can be computed in time.
-
If the type of step changes from to , the corner coincides with the vertex and becomes larger than at the 3-pivot . Since increases as corner moves forward, we can find the 3-pivot in time using a binary search.
-
If the type of step changes from to , the corner coincides with the vertex and becomes negative at the 3-pivot . Since decreases as corner moves forward, we can find the 3-pivot in time using a binary search.
We compute a candidate pivot for each of the three cases, and determine the pivot that appears first.
-
When (when are symmetric): the type of step can change from to , , or , we have four following cases:
-
If pivot does not exist, that is , two corners and move forward while corner moves backward. If is updated first, construct the parallelogram and find the intersection between the boundary of and using a binary search. Then, we can find the next head pivot in time.
Without loss of generality, assume that is updated first. Construct the parallelogram and find the intersection between the boundary of and using a binary search. If corner coincides with vertex , then . Otherwise, corner coincides with vertex , which means that . Then we need to take one more step from the pivot to find the next head pivot .
-
If the type of step changes from to , the corner coincides with the vertex and becomes equal or smaller than at the 3-pivot . Only when is updated first, decreases as corner moves forward. Thus, we can find the 3-pivot using a binary search.
-
If the type of step changes from to , the corner coincides with the vertex and becomes negative at the 3-pivot . When or is updated first, decreases as corner moves backward or corner moves forward. Thus, we can find the 3-pivot using a binary search.
-
If the type of step changes from to , the corner coincides with the vertex and becomes negative at the 3-pivot . When or is updated first, decreases as corner moves backward or corner moves forward. Thus, we can find the 3-pivot using a binary search.
We compute a candidate pivot for each of the four cases, and determine the pivot that appears first.
If pivot exists, then we find the pivot such that the type of step changes from to other type in a similar way, and so on. Since a stride has at most five types of steps, we need to use binary search at most five times.
Lemma 17 also implies that a stride consists of at most three chains and two steps with one of types , , , , , . With this lemma, we will present how to partition the global perfect rotation into a linear number of strides in the following section.
6 Partitioning the global perfect rotation
Without loss of generality, suppose that the orientation 0 is a 3-pivot of . We then sequentially apply Lemma 17 from until the global perfect rotation is entirely covered by strides. Our goal is to prove that the total number of these strides is .
To prove that the number of strides obtained by this simple algorithm is linear, we first define two notations, and , as follows.
Definition 18. For a given orientation , let and .
In other words, (resp., ) is the index of the furthest (resp., closest) edge of from the corner along in the counter-clockwise direction among the edges visited by during the perfect rotation (resp., ) (consider two edges and are distinct). Both and are monotonically increasing; thus, by the definition of , we obtain .
We analogously define , , , . Based on Definition 18, we introduce the following definition:
Definition 19. For a given orientation , let and .
From Corollary 10 and Lemma 11, we observe that some specific pivots restrict the placement of . Thus, based on Corollary 10 and Lemma 11, we prove the following lemma about :
Corollary 20. For a given step with or , and . In particular, if is 2-pivot when , or if coincides with when , then increases.
Proof. Suppose that or and . Then, there exists an orientation such that the corner moves backward and coincides with vertex . Since , (1) the corner must lie on when and (2) the corner must lie on when (otherwise, ). However, for , if corner moves backward from , (1) corner lies on since it moves forward from and, (2) corner lies on since it moves forward from , respectively. This contradicts the definition of by Corollary 10 and Lemma 11. Therefore, and the same argument applies to the pivot by replacing with .
If is 2-pivot when , or if coincides with , this means that increases at the pivot . Then, increases at the pivot since .
Corollary 20 remains valid when a, b, c are cyclically rotated.
To track whether the current location of corner is the furthest from along in the counter-clockwise direction during the perfect rotation , we use stack in the following manner. Suppose that the type of step changes from , , or to at a 3-pivot . Then, we mark the moment when corner begins to move backward by pushing the 3-pivot onto stack . We pop this pivot from stack once corner lies on the counter-clockwise side of along for some .
We also consider the two stacks and in a cyclic manner. With three stacks , , and , we prove the following lemma.
Lemma 21. Suppose that the type of step changes from , , or to at a 3-pivot ; in other words, the 3-pivot is pushed onto stack . Then, while the 3-pivot remains in stack , for ,
(i) if corner lies on , corner must lie on ; and if both corners and lie on , corner also lies on and the type of step after the 3-pivot cannot be or .
(ii) if corner lies on , corner must lie on and the type of step after the 3-pivot cannot be ; in other words, corner cannot move backward.
(iii) stack is empty at the 3-pivot . In particular, if a stride contains the 3-pivot , then, increases after passing the stride.
Proof. (i) For , corner cannot coincide with corner because stack is non-empty. If corner lies on for , then corner also lies on (otherwise, ). However, the type of step changes to at the 3-pivot ; thus, this contradicts the definition of by Lemma 11. Consequently, if corner lies on , then it must lie on , which implies that it lies on . Since corner lies on , it must lie on as well, whenever corner lies on .
The remaining case is when corner lies in the interior of . Consider the moment that corner departs from . By the previous result, both corners and must lie on . From this moment, corner continuously moves forward until corner returns to . Thus, corner remains on .
If both corners and lie on , they necessarily lie on . Then, by Corollary 10, the placement of cannot lie on a step of type or .
(ii) Since the type of step after the 3-pivot cannot be or , corner must lie on . For , corner must lie on (otherwise ). By the convexity of , we obtain , which implies that corner always moves forward.
(iii) When the 3-pivot is pushed onto stack , either (1) corner moves forward along until corner coincides with vertex , or (2) corner moves through the interior of and returns to at edge . In either case, we obtain ; thus, by applying (ii) cyclically, stack must be empty at the 3-pivot .
In the former case (1), the type of step changes from to , which increases from to at the 3-pivot ; thus, also increases since stack is empty at the 3-pivot .
In the latter case (2), the type of step changes from or to . Then, stack can contain the 3-pivot until corner reaches corner . We claim that , which implies that increases at the 3-pivot .
Consider the largest 3-pivot where corner departs from . Since the type of step changes to at the 3-pivot , we have .
If lies on , by , ; in other words, stack is already empty at the 3-pivot . Since the type of step changes from or to , we have by Lemma 15, meaning that .
Otherwise, . During the perfect rotation , corner always moves forward, and thus, . If , then we have . However, the type of step changes to at the pivot and changes to at the pivot , we obtain , which contradicts with the previous inequality. Therefore, which implies that increases.
If a stride contains the 3-pivot , then it cannot contain another 3-pivot where the type of step changes from , , or to since both and of cannot be updated during a single stride. Therefore, if any 3-pivot is pushed onto stack during a stride, increases after the stride.
Lemma 21 remains valid when are cyclically rotated. In general, the type of step can be restricted depending on whether stacks , and are empty. If any 3-pivot is pushed onto one of stacks , or during a stride, then at least one element of increases after the stride.
Theorem 22. The global perfect rotation can be covered by a linear number of strides.
Proof. Without loss of generality, suppose that orientation 0 is a pivot of and all three stacks , , are initially empty. We then sequentially apply Lemma 17 from until the global perfect rotation is entirely covered by strides. We claim that the total number of these strides is at most linear.
While all three stacks are empty, if a stride contains no steps of type , or , then at least one element of increases after the stride. Thus, the number of such strides is at most linear.
Without loss of generality, we assume that is the first stride after pivot 0 that contains a 3-pivot where the type of step changes from , , or to . Then the 3-pivot is pushed onto stack during this stride and, by part (iii) of Lemma 21, increases after passing the stride since stack is empty.
While the 3-pivot remains in stack , by Lemma 21, a stride cannot contain steps of type , , or and no pivot can be pushed onto stack . Consequently, either the 3-pivot will be popped from stack or another 3-pivot will be pushed onto stack . Before either of these two events occurs, we examine how the strides affect or ; that is, we consider the strides while only stack is non-empty.
From Lemma 16, it is enough to consider the strides that contain no steps of type , , , or . For a stride while only stack is non-empty, at least one of , , or increases after passing the stride as follows:
- From , where the set , the set , and the set :
(a) when is updated first, : either or ; thus, either or increases.
(b) when either or is updated first, then or increases since or , respectively.
- From :
(a) : since coincides with a vertex of Q, by Corollary 20, increases.
(b) : increases since .
-
From : and thus, increases since .
-
From :
(a) : increases since .
(b) : by the analysis of , either or .
- From :
(a) : increases since .
(b) : by the analysis of , either increases or .
(c) : by the analysis of , either or .
- From :
(a) or : or increases since or .
(b) : increases since .
(c) : increases since .
This implies that the number of strides while only stack is non-empty is at most linear. Since this observation remains valid when are cyclically rotated, in general, the number of strides while only one of the stacks is non-empty is also at most linear.
Suppose that the 3-pivot is popped first from stack at the orientation where is a stride. If this stride contains type or step, some 3-pivot is pushed onto stack or during the stride since there exists no or steps within the perfect rotation . Thus, or increases after passing the stride by part (iii) of Lemma 21.
If the stride is a step of type , , , or , one element of increases after passing the stride. Otherwise, differs from in at least two elements; thus, or increases. At the orientation , all three stacks , , become empty, which restores the initial configuration. Thus, we can consider the pivot as the orientation 0.
We now consider the case when another 3-pivot is pushed onto stack after the 3-pivot . Suppose that is the first stride after pivot that contains a 3-pivot where the type of step changes from , , or to . Then the 3-pivot is pushed onto stack during this stride and, by part (iii) of Lemma 21, increases after passing the stride since stack is empty.
While two stacks and are non-empty, a stride can contain only steps of type , , , or and no pivot can be pushed onto stacks or . Then we first enumerate all possible type of strides while two stacks and are non-empty as follows:
-
From : the possible types .
-
From : the possible type .
-
From : the possible types
-
From : the possible types .
By Lemma 16, increases after passing a stride with , since . Similarly, after passing a stride with , by Corollary 20, increases. By Lemma 16 again, after passing a stride with one of the remaining types , either or is satisfied. Since increases if , we assume that each stride with satisfies .
Let be the last stride such that and the 3-pivot remains in stack at the pivot , the stride contains type step, and the perfect rotation contains no type step (where and may hold). During the perfect rotation , stack can alternately become empty and non-empty.
In particular, let be the 3-pivot where the type of step changes from to another type. By Corollary 20, and by Lemma 16, the stride cannot contain type step since it contains type step; in other words, corner moves forward during the perfect rotation . Therefore, each stride with that appears within the perfect rotation while two stacks and are non-empty increases by at least one.
Additionally, if stack becomes empty while remains non-empty after passing a stride that appears within the perfect rotation , then at least one of , , or increases after passing the stride. We have already shown that at least one element of or increases after passing either a stride that occurs while only stack is non-empty or a stride that pushes a 3-pivot onto stack . Consequently, every stride that appears within the perfect rotation increases at least one element of or .
From the pivot , we now take strides until one of two stacks or becomes empty. From now on, while two stacks and are non-empty, we will focus on the strides which cannot affect the elements of or . Then, by the definition of stride , it is enough to consider the strides with after the stride . Since the type of the last step of these strides is , we assume that both and hold ( increases if ).
Suppose that be the bottom pivot in stack after the 3-pivot . Then, let be the stride with or such that and (1) stack becomes empty first after passing the stride, or (2) the last stride where lies on clockwise side of . By the definitions, after passing each stride within , increases (the stride increases or ); thus, there are at most number of strides which cannot affect the elements of or .
Consider the smallest pivot such that the such that the 3-pivot is pushed onto stack during the stride . Then, corner moves forward during the perfect rotation , i.e. . Since two 3-pivots and satisfy and , by Lemma 11, we have .
Define the strides , , and and the pivots and , analogously. Then, every stride that appear within the perfect rotation increases at least one element of or . Further, there are at most number of strides which cannot affect the elements of or . We finally claim that lies on the counter-clockwise side of .
If lies in the clockwise side of , then lies in the counter-clockwise side of since . Thus, lies in the counter-clockwise side of
Otherwise, , in other words, the corners , , appears in counter-clockwise order along . Since stack is non-empty during the perfect rotation and stack is empty at the pivot , we have , in other words, appears in counter-clockwise order along . Then, by Corollary 9, , which implies that lies on the counter-clockwise side of . Therefore, the interval from to along is disjoint with the interval from to along . This means that the number of strides which cannot affect the elements of or while two stacks and are non-empty is linear. We apply this result by permuting , cyclically.
Consequently, the number of strides that entirely cover the global perfect rotation is linear. ☐
7 Conclusion
By Theorem 22, we can partition the global perfect rotation into a linear number of strides. As we have seen in Lemma 17, each stride consists of at most three chains and two steps of one of types , or . Therefore, this proves Theorem 4.
Since a linear number of strides are obtained in counter-clockwise order with respect to angle, a linear number of chains and steps are also sorted in counter-clockwise order with respect to angle. Thus, based on the two pivots that define each chain or each step, for a given angle , we can find a chain or a step which contains in time using binary search.
If a step contains , we can easily compute the placement of . Otherwise, if a chain contains , only one element of can be changed continuously during the chain. Thus, we can present four corner-edge incidences of all pivots in the chain with space. Since we know four corner-edge incidences of each pivot, we also can compute the pivot and the placement of .
Then, there are at most pivots in each chain, so we can find a step of the chain which contains in time using binary search (computing the placement of mid-pivot, iteratively). Therefore, for a given angle , we can query the placement of in time with a linear number of chains and steps.
Finally, for each chain , we can compute the number of pivots in chain by comparing with in constant time. Thus, we can compute the complexity of silhouette in time. Since computing a step takes time by Corollary 8 and Lemma 17, we can solve the problems (2) and (3) which finds the maximum and minimum of for in time by taking steps from to , where is the complexity of silhouette (in most cases, the complexity is linear unless number of vertices of are highly concentrated within a very narrow interval of ).
References
[1] Pankaj K Agarwal, Nina Amenta, and Micha Sharir. Largest placement of one convex polygon inside another. Discrete & Computational Geometry, 19:95–104, 1998.
[2] Sang Won Bae, Sergio Cabello, Otfried Cheong, Yoonsung Choi, Fabian Stehn, and Sang Duk Yoon. The reverse Kakeya problem. Advances in Geometry, 21:75–84, 2021.
[3] Henry S. Baird. Model-based image matching using location. Massachusetts Institute of Technology, USA, 1985.
[4] Timothy M Chan and Isaac M Hair. Convex polygon containment: Improving quadratic to near linear time. In 40th International Symposium on Computational Geometry (SoCG 2024), pages 34–1. Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 2024.
[5] Bernard Chazelle. The polygon containment problem. In F. P. Preparata, editor, Advances in Computing Research, pages 1–33. JAI Press, 1983.
[6] A DePano, Yan Ke, and Joseph O'Rourke. Finding largest inscribed equilateral triangles and squares. In Proc. 25th Allerton Conf. Commun. Control Comput, pages 869–878. Univ. Illinois, 1987.
[7] Seungjun Lee, Taekang Eom, and Hee-Kap Ahn. Largest triangles in a polygon. Computational Geometry, 98:101792, 2021.
[8] G. Pál. Ein Minimumproblem für Ovale. Math. Ann., 83:311–319, 1921.
[9] Micha Sharir and Sivan Toledo. External polygon containment problems. Computational Geometry, 4:99–118, 1994.

Figure 10: Instances of and for pair

Figure 11: Instances of and for pair

Figure 12: Instances of and for pair