public boolean within(float x, float y, float[] polyX, float[] polyY) 
	{
		if (polyX.length != polyY.length) return false;
		int i, j = polyX.length-1;
		boolean oddNodes = false;
		for (i = 0; i < polyX.length; i++) 
		{
			if (polyY[i] < y && polyY[j] >= y || polyY[j] < y && polyY[i] >= y) 
			{
				if (polyX[i] + (y-polyY[i])/(polyY[j]-polyY[i])*(polyX[j]-polyX[i]) < x) 
				{
					oddNodes = !oddNodes;
				}
			}
			j = i;
		}
		return oddNodes; 
	}