# [name]

Math utility functions

## Methods

### .clamp( [page:Float x], [page:Float a], [page:Float b] ) [page:Float]

x — Value to be clamped.
a — Minimum value
b — Maximum value.
Clamps the *x* to be between *a* and *b*.

### .clampBottom( [page:Float x], [page:Float a] ) [page:Float]

x — Value to be clamped.
a — Minimum value
Clamps the *x* to be larger than *a*.

### .mapLinear( [page:Float x], [page:Float a] ) [page:Float]

x — Value to be mapped.
a1 — Minimum value for range A.
a2 — Maximum value for range A.
b1 — Minimum value for range B.
b2 — Maximum value for range B.
Linear mapping of *x* from range [*a1*, *a2*] to range [*b1*, *b2*].

### .random16() [page:Float]

Random float from 0 to 1 with 16 bits of randomness.
Standard Math.random() creates repetitive patterns when applied over larger space.

### .randInt( [page:Integer low], [page:Integer high] ) [page:Integer]

Random integer from *low* to *high* interval.

### .randFloat( [page:Float low], [page:Float high] ) [page:Float]

Random float from *low* to *high* interval.

### .randFloatSpread( [page:Float range] ) [page:Float]

Random float from *- range / 2* to *range / 2* interval.

## Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]