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:

    Every orientation presupposes a disorientation.
    Hans Magnus Enzensberger (b. 1929)

    When I think of God, when I think of him as existent, and when I believe him to be existent, my idea of him neither increases nor diminishes. But as it is certain there is a great difference betwixt the simple conception of the existence of an object, and the belief of it, and as this difference lies not in the parts or composition of the idea which we conceive; it follows, that it must lie in the manner in which we conceive it.
    David Hume (1711–1776)