actualValueToSweepAngle static method

double actualValueToSweepAngle({
  1. required double actualValue,
  2. required double maxValue,
  3. required double maxDegrees,
  4. double minValue = 0,
})

Convert the actualValue to sweepAngle.

Implementation

static double actualValueToSweepAngle({
  required double actualValue,
  required double maxValue,
  required double maxDegrees,
  double minValue = 0,
}) {
  final ratio = (actualValue - minValue) / (maxValue - minValue);
  return ratio * maxDegrees;
}