Skip to content

editor / stretchScale

Function: stretchScale() ​

stretchScale(corners, ratio): number

Defined in: geometry/stretch-scale.ts:24

Vertical scale λ of a stretched polygon for a box ratio h / w (rule C, DERIV-stretched-polygon step 5): the sound scales [λ_lo, λ_hi] found by bisection on ln λ, then the scale whose aspect is the ratio, λ_lo or λ_hi when the ratio is beyond their aspects. A ratio of NaN (a box of 0 × 0) gives λ_lo, as every comparison with it is false. The bounds are found within a rounding error: a clamped polygon's guard corner may turn π/n less about 1e-16.

Parameters ​

corners ​

number

number of corners n, an integer from 3 to 12

ratio ​

number

height of the box over its width, ≥ 0, +∞ or NaN

Returns ​

number

λ > 0

Kind ​

geometry

See ​

DERIV-stretched-polygon