Created
September 10, 2022 06:27
-
-
Save Dobby233Liu/4b16a9e461a9e133a6980bbacb87e03b to your computer and use it in GitHub Desktop.
huh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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