Class ExpCurve

java.lang.Object
frc.spectrumLib.util.Curve
frc.spectrumLib.util.ExpCurve

public class ExpCurve extends Curve
Maps a stick input in [-1, 1] through an exponential of base expVal, keeping the result in [-1, 1] and preserving sign. The scalar and offset applied after the exponent set the range of the final value.
  • Constructor Details

    • ExpCurve

      public ExpCurve()
    • ExpCurve

      public ExpCurve(double expVal, double offset, double scalar, double deadzone)
  • Method Details

    • calculate

      public double calculate(double input)
      Applies the deadzone, then the exponent, then the scalar, then the offset. The deadzone is the innermost call, so it runs first.
      Specified by:
      calculate in class Curve
    • setExpVal

      public void setExpVal(double expVal)
      A base at or below zero falls back to 1.0, leaving the input uncurved. A negative base would raise a fractional power and produce imaginary results.
    • getExpVal

      public double getExpVal()