# Function Repository Resource:

# PowerSubdivide

Subdivide an interval such that the ratio of subsequent elements is constant

Contributed by: Sander Huisman  |  SHuisman
 ResourceFunction["PowerSubdivide"][xmax,n] generates the list of values obtained by subdiving the interval from 1 to xmax into n parts such that the ratio of subsequent elements is constant. ResourceFunction["PowerSubdivide"][xmin,xmax,n] generates the list of values obtained by subdiving the interval from xmin to xmax into n parts such that the ratio of subsequent elements is constant.

## Details and Options

ResourceFunction["PowerSubdivide"] effectively behaves like Subdivide, but in "log-space".
ResourceFunction["PowerSubdivide"][, n] generates a list of length n+1.

## Examples

### Basic Examples (1)

Subdivide the range 10–10000 in 3 steps:

 In:= Out= ### Scope (3)

With two arguments, the start of the sequence is assumed to be 1:

 In:= Out= PowerSubdivide works on symbolic entries:

 In:= Out= xmin can be larger than xmax:

 In:= Out= ### Applications (1)

PowerSubdivide gives points that are "logarithmically useful" for plotting on a logarithmic scale:

 In:= Out= ### Properties and Relations (4)

The ratio between subsequent values is constant:

 In:= Out= PowerSubdivide is related to Subdivide:

 In:= Out= Negative and positive end points results in intermediate values in the complex plane:

 In:= Out= Calculate the geometric mean of two values:

 In:= Out= Compare to the built-in function:

 In:= Out= ### Possible Issues (3)

If the start or end is a negative number, intermediate values might be complex numbers:

 In:= Out= If both end points are negative real numbers, Chop might be needed to remove approximate zeros:

 In:= Out= In:= Out= Because Log(0) equals -, all but the last entry will be 0:

 In:= Out= ### Neat Examples (1)

Connect pairs of random complex numbers:

 In:= Out= 