MCPcopy
hub / github.com/bbycroft/llm-viz / lerp

Function lerp

src/utils/math.ts:3–5  ·  view source on GitHub ↗
(a: number, b: number, t: number)

Source from the content-addressed store, hash-verified

1import { clamp } from "./data";
2
3export function lerp(a: number, b: number, t: number) {
4 return a + (b - a) * clamp(t, 0, 1);
5}
6
7// we lerp after running the smoothstep, and t is clamped to [0, 1]
8export function lerpSmoothstep(a: number, b: number, t: number) {

Callers 15

walkthroughToParagraphsFunction · 0.90
blockIndexFunction · 0.90
indexMappingLinesFunction · 0.90
renderInputAtTopFunction · 0.90
renderOutputAtBottomFunction · 0.90
drawBlockLabelsFunction · 0.90
drawOLIndexLookupFunction · 0.90
drawOLPosEmbedLookupFunction · 0.90
drawArcFunction · 0.90
drawBlockFunction · 0.90
drawSymbolBetweenBlocksFunction · 0.90

Calls 1

clampFunction · 0.90

Tested by

no test coverage detected