public static double getAngleInYPlane(final Vector3D a, final Vector3D b)
	{
		double cosine = 1.0;
		double length = (a.lengthInYPlane() * b.lengthInYPlane());
		if(length > 0.0000000001)
			cosine = (a.x * b.x + a.z * b.z) / length;
		// rounding errors might make dotproduct out of range for cosine
		if(cosine > 1)
			cosine = 1;
		else if(cosine < -1)
			cosine = -1;

		if((a.x * b.z - a.z * b.x) < 0)
			return Math.acos(cosine);
		else
			return -Math.acos(cosine);
	}