public static double Interpolate(double v1, double p1, double v2, double p2, double p3)
		{
			double alpha = (p3 - p1) / (p2 - p1);
			alpha = MathHelper.Saturate(alpha);
			return v1 * alpha + v2 * (1 - alpha);
		}
		public static bool CheckPosition(Vector3 position, double[,,] array, double missingValue)
		{
			int i = array.GetLength(0);
			int j = array.GetLength(1);
			int k = array.GetLength(2);

			if (position.X >= 0 && position.X < i && position.Y >= 0 && position.Y < j && position.Z >= 0 && position.Z < k && !MathHelper.MissingCheck(position, array, missingValue))
				return true;
			else
				return false;

		}