import type { array } from "../types"; /** * Create linearly spaced arrays. * * Creates an array of `n` linearly spaced points between `a` and `b`, inclusive. * * @param a The lower bound * @param b The upper bound * @param n The number of points to generate. Defaults to 10 if not provided * @returns An array of `n` linearly spaced points between `a` and `b` * * @example Generate 5 linearly spaced points between 1 and 10 * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertEquals(linspace(1, 10, 5), [1, 3.25, 5.5, 7.75, 10]); * * ``` * * @example Generate 3 linearly spaced points between -10 and 10 * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertEquals(linspace(-10, 10, 3), [-10, 0, 10]); * * ``` * * @example Generate 2 linearly spaced points between -5 and 5 * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertEquals(linspace(-5, 5, 2), [-5, 5]); * * ``` * * @example Generate a single point (n = 1), should return only the upper bound * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertEquals(linspace(2, 5, 1), [5]); * * ``` * * @example Generate 10 linearly spaced points between 0 and 1 * ```ts * import { assertEquals, assertThrows } from "jsr:@std/assert"; * * assertEquals( * linspace(0, 1), * [0, 0.1111111111111111, 0.2222222222222222, 0.3333333333333333, 0.4444444444444444, 0.5555555555555556, 0.6666666666666666, 0.7777777777777777, 0.8888888888888888, 1] * ); * ``` */ export default function linspace(a: number, b: number, n?: number): array; //# sourceMappingURL=linspace.d.ts.map