/// <summary>
        ///     Returns a random number in range [0,1] from an exponential distribution.
        /// </summary>
        /// <returns>Random number in range [0,1] from given exponential distribution.</returns>
        /// <param name="exponent">
        ///     Exponent for distribution. Must be >= 0.
        ///     0 will be uniform distribution; 1 will be linear distribution w/ slope 1.
        /// </param>
        /// <param name="direction">The direction for the curve (right/left).</param>
        public static float RandomFromExponentialDistribution(float exponent, Direction_e direction)
        {
            // our curve will go from 0 to 1.
            var max_cdf = ExponentialRightCDF(1.0f, exponent);

            var u     = Random.Range(0.0f, max_cdf);
            var x_val = EponentialRightInverseCDF(u, exponent);

            if (direction == Direction_e.Left)
            {
                x_val = 1.0f - x_val;
            }

            return(x_val);
        }
        /// <summary>
        ///     Returns random in range [0,1] from a curved right slope.
        /// </summary>
        /// <returns>Random in range [0,1] from a curved right slope.</returns>
        /// <param name="skew">The difference in height between max and min of curve.</param>
        public static float RandomFromSlopedDistribution(float skew, Direction_e direction)
        {
            // the difference in scale is just the same as the max y-value..
            var max_y = skew;

            // our curve will go from 0 to max_x.
            var max_x = Inverse_Sec_Sqrd(max_y);

            var max_cdf = Sec_Sqrd_CumulativeDistributionFunction(max_x);

            var u     = Random.Range(0.0f, max_cdf);
            var x_val = Sec_Sqrd_InverseCumulativeDistributionFunction(u);

            // scale to [0,1]
            var value = x_val / max_x;

            if (direction == Direction_e.Left)
            {
                value = 1.0f - value;
            }

            return(value);
        }
	/// <summary>
	/// Returns a random number in range [0,1] from an exponential distribution.
	/// </summary>
	/// <returns>Random number in range [0,1] from given exponential distribution.</returns>
	/// <param name="exponent">
	/// Exponent for distribution. Must be >= 0.
	///   0 will be uniform distribution; 1 will be linear distribution w/ slope 1.
	/// </param>
	/// <param name="direction">The direction for the curve (right/left).</param>
	public static float RandomFromExponentialDistribution(float exponent, Direction_e direction) {

		// our curve will go from 0 to 1.
		float max_cdf = ExponentialRightCDF(1.0f, exponent);
		
		float u = Random.Range(0.0f, max_cdf);
		float x_val = EponentialRightInverseCDF(u, exponent);
		
		if (direction == Direction_e.Left) {
			x_val = 1.0f - x_val;
		}
		
		return x_val;

	}
	//--------------------------------------------------------------------------------------------
	// Exponential Distribution 
	//--------------------------------------------------------------------------------------------

	/// <summary>
	/// Returns a random number in range [min,max] from an exponential distribution.
	/// </summary>
	/// <returns>Random number in range [min,max] from given exponential distribution.</returns>
	/// <param name="min">Minimum random number (inclusive).</param>
	/// <param name="max">Maximum random number (inclusive).</param>
	/// <param name="exponent">
	/// Exponent for distribution. Must be >= 0.
	///   0 will be uniform distribution; 1 will be linear distribution w/ slope 1.
	/// </param>
	/// <param name="direction">The direction for the curve (right/left).</param>
	public static float RandomRangeExponential(float min, float max, float exponent, Direction_e direction) {
		return min + RandomFromExponentialDistribution(exponent, direction) * (max-min);
	}
	/// <summary>
	/// Returns random in range [0,1] from a curved right slope.
	/// </summary>
	/// <returns>Random in range [0,1] from a curved right slope.</returns>
	/// <param name="skew">The difference in height between max and min of curve.</param>
	public static float RandomFromSlopedDistribution(float skew, Direction_e direction) {

		// the difference in scale is just the same as the max y-value..
		float max_y = skew;

		// our curve will go from 0 to max_x.
		float max_x = Inverse_Sec_Sqrd(max_y);

		float max_cdf = Sec_Sqrd_CumulativeDistributionFunction(max_x);

		float u = Random.Range(0.0f, max_cdf);
		float x_val = Sec_Sqrd_InverseCumulativeDistributionFunction(u);

		// scale to [0,1]
		float value = x_val / max_x;

		if (direction == Direction_e.Left) {
			value = 1.0f - value;
		}
		
		return value;
	}
	/// <summary>
	/// Returns a random number in range [min,max] from a curved slope following sec^2(x).
	/// </summary>
	/// <returns>Random in range [min,max] from a curved left slope.</returns>
	/// <param name="skew">The difference in height between max and min of curve.</param>
	public static float RandomRangeSlope(float min, float max, float skew, Direction_e direction) {
		return  min + RandomFromSlopedDistribution(skew, direction) * (max-min);
	}
        //--------------------------------------------------------------------------------------------
        // Exponential Distribution
        //--------------------------------------------------------------------------------------------

        /// <summary>
        ///     Returns a random number in range [min,max] from an exponential distribution.
        /// </summary>
        /// <returns>Random number in range [min,max] from given exponential distribution.</returns>
        /// <param name="min">Minimum random number (inclusive).</param>
        /// <param name="max">Maximum random number (inclusive).</param>
        /// <param name="exponent">
        ///     Exponent for distribution. Must be >= 0.
        ///     0 will be uniform distribution; 1 will be linear distribution w/ slope 1.
        /// </param>
        /// <param name="direction">The direction for the curve (right/left).</param>
        public static float RandomRangeExponential(float min, float max, float exponent, Direction_e direction)
        {
            return(min + RandomFromExponentialDistribution(exponent, direction) * (max - min));
        }
 /// <summary>
 ///     Returns a random number in range [min,max] from a curved slope following sec^2(x).
 /// </summary>
 /// <returns>Random in range [min,max] from a curved left slope.</returns>
 /// <param name="skew">The difference in height between max and min of curve.</param>
 public static float RandomRangeSlope(float min, float max, float skew, Direction_e direction)
 {
     return(min + RandomFromSlopedDistribution(skew, direction) * (max - min));
 }