Skip to content

editor / stretchedSideDirections

Function: stretchedSideDirections() ​

stretchedSideDirections(corners, scale): readonly number[]

Defined in: geometry/stretched-side-directions.ts:16

Directions of the sides of a stretched polygon's right half, after its half base: the directions θⱼ = 2πj/n of the regular polygon scaled vertically by λ, φⱼ = atan2(λ sin θⱼ, cos θⱼ), in (0, π) since sin θⱼ > 0. For an odd n, the last side closes the half on the axis, φₘ = acos(−1/2 − Σⱼ₍ₘ cos φⱼ), which is NaN when no side can (DERIV-stretched-polygon steps 1–2). At λ = 1 they are the regular directions.

Parameters ​

corners ​

number

number of corners n, an integer from 3 to 12

scale ​

number

vertical scale λ > 0

Returns ​

readonly number[]

the ⌈n/2⌉ − 1 directions, in radians, from the base upwards

Kind ​

geometry

See ​

DERIV-stretched-polygon