private bool ValidPolygonAngles(int numpoints, double[] points)
{
int i;//,j
for (i = 0; i < numpoints; i++)
{
if (i == numpoints - 1)
{
if (IsBadPolygonAngle(points[i * 2], points[i * 2 + 1], points[0], points[1], points[2], points[3]))
{
return false; // one of the inner angles is less than required
}
}
else if (i == numpoints - 2)
{
if (IsBadPolygonAngle(points[i * 2], points[i * 2 + 1], points[(i + 1) * 2], points[(i + 1) * 2 + 1], points[0], points[1]))
{
return false; // one of the inner angles is less than required
}
}
else
{
if (IsBadPolygonAngle(points[i * 2], points[i * 2 + 1], points[(i + 1) * 2], points[(i + 1) * 2 + 1], points[(i + 2) * 2], points[(i + 2) * 2 + 1]))
{
return false; // one of the inner angles is less than required
}
}
}
return true; // all angles are valid
}