Skip to content

Instantly share code, notes, and snippets.

@Dobby233Liu
Created September 10, 2022 06:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dobby233Liu/4b16a9e461a9e133a6980bbacb87e03b to your computer and use it in GitHub Desktop.
Save Dobby233Liu/4b16a9e461a9e133a6980bbacb87e03b to your computer and use it in GitHub Desktop.
huh
import math
osr = 2
isr = 10
smps = [0, 1]
def lerp(a, b, m):
return a + m * (b-a)
smpin = []
def wrb(b):
print(b)
for i in range(math.ceil(isr * (len(smps) / osr))):
ciop = i / isr * osr
print(ciop, i, "!!")
if ciop % 1 == 0:
wrb(smps[int(ciop)])
else:
unprg = ciop % 1
uni = int(ciop - unprg)
if uni + 1 >= len(smps):
wrb(smps[uni])
continue
wrb(lerp(smps[uni], smps[uni + 1], unprg))
print('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment