Kelary.Infrastructure/Converters/LinearTransformConverter.cs
/// <summary>
/// Perform linear conversion a0 + x * a1 for value.
/// </summary>
/// <param name="value"></param>
/// <param name="targetType"></param>
/// <param name="parameter"></param>
/// <param name="culture"></param>
/// <returns></returns>
Perform linear conversion a0 + x * a1 for value.
Perform linear conversion a0 + x * a1 for value .
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            double x = GetDoubleValue(value, 0.0);
            var coeff = GetCoefficients(parameter);
            return coeff[0] + x * coeff[1];
        }
public object Convert ( object value , Type targetType , object parameter , System . Globalization . CultureInfo culture ) { double x = GetDoubleValue ( value , 0.0 ) ; var coeff = GetCoefficients ( parameter ) ; return coeff [ 0 ] + x * coeff [ 1 ] ; }
Perform linear conversion a0 + x * a1 for value.
Perform linear conversion a0 + x * a1 for value .
None
value
object
None
targetType
Type
None
parameter
object
None
culture
System.Globalization.CultureInfo
None