This commit is contained in:
Miloslav Ciz 2024-08-01 02:31:53 +02:00
parent df80221a15
commit 9fc5ae8d5b
16 changed files with 2136 additions and 1807 deletions

View file

@ -29,7 +29,7 @@ Many times we apply our interpolation not just to two points but to many points,
**[Nearest neighbor](nearest_neighbor.md)** is probably the simplest interpolation (so simple that it's sometimes not even called an interpolation, even though it technically is). This method simply returns the closest value, i.e. either *A* (for *t* < 0.5) or *B* (otherwise). This creates kind of sharp steps between the points, the function is not continuous, i.e. the transition between the points is not gradual but simply jumps from one value to the other at one point.
**[Linear interpolation](lerp.md)** (so called lerp) is probably the second simplest interpolation which steps from the first point towards the second in a constant step, creating a straight line between them. This is simple and [good enough](good_enough.md) for many things, the function is continuous but not smooth, i.e. there are no "jumps" but there may be "sharp turns" at the points, the curve may look like a "saw".
**[Linear interpolation](lerp.md)** (so called LERP, not to be [confused](often_confused.md) with [LARP](larp.md)) is probably the second simplest interpolation which steps from the first point towards the second in a constant step, creating a straight line between them. This is simple and [good enough](good_enough.md) for many things, the function is continuous but not smooth, i.e. there are no "jumps" but there may be "sharp turns" at the points, the curve may look like a "saw".
**[Cosine](cos.md) interpolation** uses part of the [cosine](cos.md) function to create a continuous and smooth line between the points. The advantage over linear interpolation is the smoothness, i.e. there aren't "sharp turns" at the points, just as with the more advanced cubic interpolation against which cosine interpolation has the advantage of still requiring only the two interval points (*A* and *B*), however for the price of a disadvantage of always having the same horizontal slope at each point which may look weird in some situations (e.g. multiple points lying on the same sloped line will result in a curve that looks like smooth steps).