in reply to Clockwise or Counter-clockwise

Given 3 2d non-colinear points in sequence, create the 3d vectors v1 = p1->p2 and v2 = p1->p3 on the z0 plane. calculate v3 = v1 X v2. if v3 has positive z then they are in counter-clockwise order, negative z then clockwise.

this is the right-hand rule, place your right hand on p1->p2 and curl your fingers onto p2->p3, if your thumb points up they go counter clockwise, if it points down they go clockwise.

i really need to look for an HTML equation editor...

Replies are listed 'Best First'.
Re(2): Clockwise or Counter-clockwise
by FoxtrotUniform (Prior) on Feb 19, 2003 at 06:08 UTC
      Given 3 2d non-colinear points in sequence, create the 3d vectors v1 = p1->p2 and v2 = p1->p3 on the z0 plane. calculate v3 = v1 X v2. if v3 has positive z then they are in counter-clockwise order, negative z then clockwise.

    That only works if the polygon in question is convex, otherwise local orientation says nothing about the polygon's orientation (unless you pick your locale cleverly, of course).

    Take the example of a banana-shaped counterclockwise polygon: the interior section will have a "clockwise" orientation.

    --
    F o x t r o t U n i f o r m
    Found a typo in this node? /msg me
    The hell with paco, vote for Erudil!

      Given 3 2d non-colinear points in sequence there's no such thing as convex or concave. (that's why i didn't go with 3 or more...) =P

        Given 3 2d non-colinear points in sequence there's no such thing as convex or concave.

        I think you mean to say that they form a triangle, and all triangles are convex.