logarithmicSpaced function

Vector<double> logarithmicSpaced(
  1. double start,
  2. double stop, {
  3. int count = 10,
  4. double base = 10.0,
  5. bool includeEndpoint = true,
  6. DataType<double>? dataType,
  7. VectorFormat? format,
})

Generates a Vector with a sequence of count evenly spaced values on a log scale (a geometric progression) on the interval between base ^ start and base ^ stop.

Implementation

Vector<double> logarithmicSpaced(
  double start,
  double stop, {
  int count = 10,
  double base = 10.0,
  bool includeEndpoint = true,
  DataType<double>? dataType,
  VectorFormat? format,
}) {
  final linear = linearSpaced(start, stop,
      count: count, includeEndpoint: includeEndpoint, dataType: dataType);
  final logarithmic = linear.map((i, x) => pow(base, x).toDouble(), dataType);
  return format == null ? logarithmic : logarithmic.toVector(format: format);
}