namespace JD.Kernel.Structs { /// /// A numerical range (a max and a min). /// /// /// This class is immutable. /// public static class RangeExtension { #region Properties /// /// Width of the range. /// public static float Width(this Range range) { return range.Max - range.Min; } #endregion #region Methods /// /// Returns a new range with min and max inflated by the given on each side. /// /// /// Note that the width of the range gets increased/decreased by 2 * . /// /// /// public static Range Inflate(this Range range, float value) { return new Range(range.Min - value, range.Max + value); } #endregion } }