linearly v0.32.0Docs


linearly v0.32.0 / vec2 / clamp

Function: clamp()

clamp(v, min, max): vec2

Constrain a value to lie between two further values

Parameters

v: vec2

the value to constrain

min: number | vec2

the lower end of the range into which to constrain v

max: number | vec2

the upper end of the range into which to constrain v

Returns

vec2

See

https://thebookofshaders.com/glossary/?search=clampopen in new window

Defined in

src/vec2.ts:206open in new window