Curve Orientation - Orientation of A Simple Polygon

Orientation of A Simple Polygon

In two dimensions, given an ordered set of three or more connected vertices (points) (such as in connect-the-dots) which forms a simple polygon, the orientation of the resulting polygon is directly related to the sign of the angle at any vertex of the convex hull of the polygon, for example, of the angle ABC in the picture. In computations, the sign of the smaller angle formed by a pair of vectors is typically determined by the sign of the cross product of the vectors. The latter one may be calculated as the sign of the determinant of their orientation matrix. In the particular case when the two vectors are defined by two line segments with common endpoint, such as the sides BA and BC of the angle ABC in our example, the orientation matrix may be defined as follows:

\mathbf{O} = \begin{bmatrix}
1 & x_{A} & y_{A} \\
1 & x_{B} & y_{B} \\
1 & x_{C} & y_{C}\end{bmatrix}.

A formula for its determinant may be obtained, e.g., using the method of cofactor expansion:

\begin{align}
\det(O) &= 1\begin{vmatrix}x_{B}&y_{B}\\x_{C}&y_{C}\end{vmatrix}
-x_{A}\begin{vmatrix}1&y_{B}\\1&y_{C}\end{vmatrix}
+y_{A}\begin{vmatrix}1&x_{B}\\1&x_{C}\end{vmatrix} \\
&= x_{B}y_{C}-y_{B}x_{C}-x_{A}y_{C}+x_{A}y_{B}+y_{A}x_{C}-y_{A}x_{B} \\
&= (x_{B}y_{C}+x_{A}y_{B}+y_{A}x_{C})-(y_{A}x_{B}+y_{B}x_{C}+x_{A}y_{C}).
\end{align}

If the determinant is negative, then the polygon is oriented clockwise. If the determinant is positive, the polygon is oriented counterclockwise. The determinant is non-zero if points A, B, and C are non-collinear. In the above example, with points ordered A, B, C, etc., the determinant is negative, and therefore the polygon is clockwise.

Read more about this topic:  Curve Orientation

Famous quotes containing the words orientation and/or simple:

    Institutions of higher education in the United States are products of Western society in which masculine values like an orientation toward achievement and objectivity are valued over cooperation, connectedness and subjectivity.
    Yolanda Moses (b. 1946)

    What have Massachusetts and the North sent a few sane representatives to Congress for, of late years?... All their speeches put together and boiled down ... do not match for manly directness and force, and for simple truth, the few casual remarks of crazy John Brown on the floor of the Harper’s Ferry engine-house,—that man whom you are about to hang, to send to the other world, though not to represent you there.
    Henry David Thoreau (1817–1862)