static bool IsCW(VertexStore myvxs, int start, int end) { // Calculate signed area (double area to be exact) //--------------------- int np = end - start; double area = 0.0; int i; for (i = 0; i < np; i++) { double x1, y1, x2, y2; myvxs.GetVertexXY(start + i, out x1, out y1); myvxs.GetVertexXY(start + (i + 1) % np, out x2, out y2); area += x1 * y2 - y1 * x2; } return(area < 0.0); //return (area < 0.0) ? ShapePath.FlagsAndCommand.FlagCW : ShapePath.FlagsAndCommand.FlagCCW; }