revisedDepth property

double revisedDepth

Returns a revised depth (0-1) based on the provided depth.

Implementation

double get revisedDepth {
  const double thresholdMin = 0.1;
  const double thresholdMax = 1.0;

  // If the depth exceeds the minimum
  if (depth > thresholdMax) {
    // Return the lower threshold as base depth
    return ((thresholdMax) - 1.0).abs();
  }
  // If the depth exceeds the maximum
  if (depth < thresholdMin) {
    // Return the upper threshold as base depth
    return ((thresholdMin) - 1.0).abs();
  }
  return ((depth) - 1.0).abs();
}