getGraph method

FunctionGraph getGraph(
  1. double function(
    1. double
    ), {
  2. double stepSize = 0.01,
  3. double? xMin,
  4. double? xMax,
  5. double dt = 1e-8,
  6. List<double> discontinuities = const [],
  7. Color color = WHITE,
})

Implementation

FunctionGraph getGraph(
  double Function(double) function, {
  double stepSize = 0.01, // use a step size <= 0 for automatic step size
  double? xMin,
  double? xMax,
  double dt = 1e-8,
  List<double> discontinuities = const [],
  Color color = WHITE,
}) {
  xMin ??= this.xMin;
  xMax ??= this.xMax;

  var graph = FunctionGraph(
    function: function,
    stepSize: stepSize,
    xMin: xMin,
    xMax: xMax,
    dt: dt,
    discontinuities: discontinuities,
    color: color,
  )..applyFunction((pt) => coordsToPoint(pt));

  return graph;
}