public double Map(double value) { if (value < source.Start || value > source.End) { throw new ArgumentOutOfRangeException("value"); } double fraction = (value - source.Start) / (source.End - source.Start); return(Scalars.InterpolateLinear(destination.Start, destination.End, fraction)); }