for (int i = 1; i < vertices.getNumPoints(); i++)
{
Coordinate p2 = vertices.getCoordinateN(i);
Coordinate p3 = vertices.getCoordinateN((i + 1) % vertices.getNumPoints());
GVector e1=new GVector(new double[] {p1.x,p1.y});
e1.sub(new GVector(new double[] {p2.x,p2.y}));
GVector e2=new GVector(new double[] {p3.x,p3.y});
e2.sub(new GVector(new double[] {p2.x,p2.y}));
if (e1.getElement(0)* e2.getElement(1) - e1.getElement(1) * e2.getElement(0) >= 0)