Skip to content
Back to skills

Smooth Interpolation

ASecurity

Animate values smoothly using exponential decay instead of linear interpolation.

  • 31 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 27, 2026
developmentgit

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add verekia/r3f-gamedev --skill smooth-interpolation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Smooth Interpolation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Smooth Interpolation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/verekia-smooth-interpolation/badge)](https://www.skillsdirectory.com/skills/verekia-smooth-interpolation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: smooth-interpolation
description: Animate values smoothly using exponential decay instead of linear interpolation.
---

# Smooth Interpolation

Animate values smoothly using exponential decay instead of linear interpolation.

## Technique

Use exponential smoothing formulas to interpolate between current and target values. This creates a natural easing effect that's frame-rate independent.

## Key Concepts

- Exponential smoothing: `(target - current) * (1 - Math.exp(-speed * dt))`
- Exponential decay: `target + (current - target) * Math.exp(-decay * dt)`
- Both formulas produce the same result with different parameters
- Speed/decay values from 1-25 work well
- Frame-rate independent due to delta time usage

## Usage

```tsx
const addSmoothExp = (current: number, target: number, speed: number, dt: number) =>
  (target - current) * (1 - Math.exp(-speed * dt))

const expDecay = (current: number, target: number, decay: number, dt: number) =>
  target + (current - target) * Math.exp(-decay * dt)

useFrame((_, delta) => {
  mesh.position.x += addSmoothExp(mesh.position.x, targetX, 3, delta)
  // or
  mesh.position.x = expDecay(mesh.position.x, targetX, 3, delta)
})
```

## References

- [Exponential Smoothing](https://lisyarus.github.io/blog/posts/exponential-smoothing.html)
- [Lerp Smoothing is Broken](https://www.youtube.com/watch?v=LSNQuFEDOyQ)

---

This skill is part of [verekia](https://x.com/verekia)'s [**r3f-gamedev**](https://github.com/verekia/r3f-gamedev).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.