toP property Null safety

NormalOperation toP
final

Implementation

static final NormalOperation toP = NormalOperation.floatOnly(
    floatCalc: (Model m) {
      double x = m.xF;
      double y = m.yF;
      m.resultXF = sqrt(x * x + y * y);
      m.yF = atan2(y, x) / m.trigMode.scaleFactor;
    },
    complexCalc: (Model m) {
      Complex v = m.xC;
      m.resultXC = Complex(sqrt(v.real * v.real + v.imaginary * v.imaginary),
          atan2(v.imaginary, v.real) / m.trigMode.scaleFactor);
    },
    name: '->P');