def setup
background(200)
a = 20
b = 80
c = lerp(a, b, 0.2)
d = lerp(a, b, 0.5)
e = lerp(a, b, 0.8)
y = 50
strokeWeight(5)
stroke(0) # Draw the original points in black
point(a, y)
point(b, y)
stroke(100) # Draw the lerp points in gray
point(c, y)
point(d, y)
point(e, y)
end
2つの数値の中間にある数値を計算します。
| 引数名 | 内容 | 備考 | オプション | デフォルト値 |
|---|---|---|---|---|
| start | 最初の数値 | |||
| stop | 2番目の数値 | |||
| amt | 中間度 | 0~1 |
2つの数値の中間にある数値