//
// Distributed under the BSD Licence (see LICENCE file).
//
// Copyright (c) 2014, Nition, http://www.momentstudio.co.nz/
// Copyright (c) 2017, Máté Cserép, http://codenet.hu
// All rights reserved.
//
namespace Octree
{
///
/// Auxiliary mathematical functions.
///
public static class MathExtensions
{
///
/// Clamps a value between a minimum and maximum value.
///
/// The value.
/// The minimum.
/// The maximum.
/// The clamped value.
public static double Clamp(double value, double min, double max)
{
if (value < min)
return min;
if (value > max)
return max;
return value;
}
}
}