When there is a decreasing continuous function relating the parameters, then the parametric representations are opposite and the orientation of the curve is reversed.
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: A formula for its determinant may be obtained, e.g., using the method of cofactor expansion: If the determinant is negative, then the polygon is oriented clockwise.
When it is not known in advance that the sequence of points defines a simple polygon, the following things must be kept in mind.
In "mild" cases of self-intersection, with degenerate vertices when three consecutive points are allowed be on the same straight line and form a zero-degree angle, the concept of "interior" still makes sense, but an extra care must be taken in selection of the tested angle.
A solution is to test consecutive corners along the polygon (BCD, DEF,...) until a non-zero determinant is found (unless all points lie on the same straight line).
For example, in the polygon pictured above, if we wanted to know whether the sequence of points F-G-H is concave, convex, or collinear (flat), we construct the matrix If the determinant of this matrix is 0, then the sequence is collinear - neither concave nor convex.
If the determinant has the same sign as that of the orientation matrix for the entire polygon, then the sequence is convex.
The following table illustrates rules for determining whether a sequence of points is convex, concave, or flat: