# lerp-array

> lerps two numbers or an array of numbers

Latest version **1.1.1** (published 2014-12-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install lerp-array
pnpm add lerp-array
yarn add lerp-array
bun add lerp-array
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2014-12-04 |
| First published | 2014-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | lerp, linear, interpolate, interpolation, array, number, arrays, vector, color, tween, animate, colors, vec2, vec3, vec4 |

## Links

- npm: https://www.npmjs.com/package/lerp-array
- Repository: https://github.com/mattdesl/lerp-array
- Issues: https://github.com/mattdesl/lerp-array/issues
- npm.io page: https://npm.io/package/lerp-array

## Dependencies (1)

- [lerp](https://npm.io/package/lerp.md) ^1.0.0

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2014-12-04
- 1.0.4 — 2014-12-04
- 1.0.2 — 2014-09-11
- 1.0.1 — 2014-09-11
- 1.0.0 — 2014-09-11

## README

# lerp-array

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Quickly [lerps](https://nodei.co/npm/lerp/) two numbers or two parallel arrays of numbers (e.g. vectors, colors, etc). 

```js
var lerp = require('lerp-array')

//RGB colors
var color1 = [0, 255, 0]
var color2 = [255, 0, 0]

//lerp the two
var color3 = lerp(color1, color2, 0.5)
```

## Usage

[![NPM](https://nodei.co/npm/lerp-array.png)](https://nodei.co/npm/lerp-array/)

#### `lerp(v1, v2, t[, out])`

Linearly interpolates `v1` to `v2` using the `t` component. If both `v1` and `v2` are number types, this is equivalent to a straight lerp. If the two are array types, they are lerped in parallel. This assumes both arrays are the same length (only uses the length of `v1`).

You can optionally specify an `out` parameter to re-use an array object. Otherwise, a new one will be created.

If the two arrays have different sizes, the length of the smallest will prevail.

## License

MIT, see [LICENSE.md](http://github.com/mattdesl/lerp-array/blob/master/LICENSE.md) for details.

---
_Source: https://npm.io/package/lerp-array · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
