INNER CODE UNIT · Dart
norm
roipeker/graphx · lib/src/math.dart:203
final norm = Math.norm(srcValue, srcMin, srcMax);
return Math.lerp(dstMin, dstMax, norm);
}
/// Normalizes a value within a given range.
///
/// Given a [value], [min] and [max], returns a normalized value between 0
/// and 1, representing the position of the [value] within the [min]-[max]
/// range.
///
/// Example:
/// ```dart
/// final value = 50;
/// final min = 0;
/// final max = 100;
/// final normalizedValue = Math.norm(value, min, max);
/// print(normalizedValue); // 0.5
/// ```