logspace(a: number,b: number,n?: number,): array
Create logarithmically spaced arrays.
Generates an array of logarithmically spaced points between 10a and 10b (inclusive).
If the number of points n is not provided, it defaults to 10.
Logarithmically spaced points from 100 to 101 with 5 points
Logarithmically spaced points from 100 to 101 with 5 points
import { assertEquals } from "jsr:@std/assert"; assertEquals( logspace(0, 1, 5), [1, 1.7782794100389228, 3.1622776601683795, 5.623413251903491, 10] );
Default 10 points from 100 to 102
Default 10 points from 100 to 102
import { assertEquals } from "jsr:@std/assert"; assertEquals( logspace(0, 2), [ 1, 1.6681005372000588, 2.7825594022071245, 4.641588833612778, 7.742636826811269, 12.91549665014884, 21.544346900318832, 35.93813663804626, 59.94842503189409, 100, ] );
Single point (start and end are the same)
Single point (start and end are the same)
import { assertEquals } from "jsr:@std/assert"; assertEquals(logspace(1, 1, 1), [10]);
An array of logarithmically spaced points