public boolean isDiagonal(int p1Index, int p2Index) {
		Point p1 = points.get(p1Index);
		Point p2 = points.get(p2Index);
		boolean result;
		/*
		 * Neighborhood test.
		 */
		Point ccwNeighbor = points.get((p1Index + 1) % points.size());
		Point cwNeighbor = points.get((p1Index + points.size() - 1) % points.size());
		if (Point.getOrientation(cwNeighbor, p1, ccwNeighbor) == Point.Orientation.COUNTER_CLOCKWISE) {
			result = (Point.getOrientation(p1, p2, cwNeighbor) == Point.Orientation.COUNTER_CLOCKWISE)
					&& (Point.getOrientation(p2, p1, ccwNeighbor) == Point.Orientation.COUNTER_CLOCKWISE);
		} else {
			/*
			 * (cwNeighbor, p1, ccwNeighbor) are assumed to be non colinear.
			 */
			result = Point.getOrientation(p1, p2, ccwNeighbor) == Point.Orientation.CLOCKWISE;
		}

		if (!result) {
			return false;
		}

		/*
		 * Check if the line segment formed by the given points intersects any
		 * edge of the polygon. If it does, then the line segment is not
		 * entirely inside the polygon.
		 */
		for (int i = 0; i < points.size(); i++) {
			Point j1 = points.get(i);
			Point j2 = points.get((i + 1) % points.size());
			if (!(j1.equals(p1) || j2.equals(p1) || j1.equals(p2) || j2.equals(p2))) {
				if (Point.intersects(p1, p2, j1, j2)) {
					return false;
				}
			}
		}

		return true;
	}