private static boolean insideTriangle(double xCoord, double yCoord, double x1, double y1, double x2, double y2, double x3,double y3)
	{
		double ABC = Math.abs (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));
		double ABP = Math.abs (x1 * (y2 - yCoord) + x2 * (yCoord - y1) + xCoord * (y1 - y2));
		double APC = Math.abs (x1 * (yCoord - y3) + xCoord * (y3 - y1) + x3 * (y1 - yCoord));
		double PBC = Math.abs (xCoord * (y2 - y3) + x2 * (y3 - yCoord) + x3 * (yCoord - y2));
        boolean isInTriangle = (ABP + APC + PBC == ABC);
		
		return isInTriangle;
	}