# Linear interpolation

*158*pages on

this wiki

**Linear interpolation**, in computer graphics often called "LERP" (**L**inear int**erp**olation), is a very (if not THE simplest) method of interpolation.

For a set of discrete values linear interpolation can approximate other values inbetween, assuming a linear developement between these discrete values. An interpolated value, calculated with linear interpolation, is calculated only in respect to the two surrounding values, which makes it a quite inappropriate choice if the desired curve should be smooth. If a curvier interpolation is needed, Splines might be an option.

To calculate a value between two other values, using linear interpolation, a certain factor, often called "step", must be used. The value has to be between value 1 (v0) and value 2 (v1). If "step" is 0.0 the interpolated value is equal to v0 and if step is 1.0, it's equal to v1. So the formula is as follows:

or (computationally a more efficient way):

#### AlternativelyEdit

Given two points () on a graph. A value can be calculated like this:

or this:

Where is the step-value.