public boolean isConvex() throws TypeOverflowException {
		
		int signPlus  = 0,
			signMinus = 0;
		double z;
		
		int n = vertices.size();
		for (int i = 0; i < n; ++i) {
			int j = (i + 1) % n;
			int k = (i + 2) % n;
			z  = (vertices.get(j).x - vertices.get(i).x) * (vertices.get(k).y - vertices.get(j).y);
			z -= (vertices.get(j).y - vertices.get(i).y) * (vertices.get(k).x - vertices.get(j).x);
			if (z < 0) ++signMinus;
			if (z > 0) ++signPlus;
			if (Double.isInfinite(z) || Double.isNaN(z))
				throw new TypeOverflowException();
			if (signMinus != 0 && signPlus != 0)
				return false;
		}
		if (signMinus != 0 && signPlus != 0) 
			return false;
		else
			return true;
	}