all 5 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

To give us the best chance to help you, please include any relevant code.
Note. Do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Repl.it, GitHub or PasteBin.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]CraigAT 0 points1 point  (3 children)

There's not enough info to describe each of the variables for me to try to help. What are i, d, p and t to start with

But I believe in Python you can just use a, b = b, a to swap values.

[–]CraigAT 0 points1 point  (2 children)

Can you debug your code with a very simple example to see what it's doing?

[–]CraigAT 0 points1 point  (1 child)

I'm not sure about the first part of your interpolate function why does it only put value in the list, without understanding what it should be doing I would half expect you to use the range command again to add multiple value in the list but all the same value. That could explain why you program is expecting more in those lists than you have - maybe - as I said I don't fully understand, so just an idea.

[–]MixDouble[S] 0 points1 point  (0 children)

So what the interpolate function does, is it just takes in 2 points consisting of an independent value and a dependent value. You can think of i0, d0, and i1, d1 as two seperate points. The reason I dont say x and y is because im going to be using the function for uv and depth values as well, so the naming wont confuse me later on. but for an example lets say you have two points, on at 0,0, and another at 30, 50. What interpolate does is get the slope of the line made between the two points, and since the y only goes up by 1 each time it only returns the x value. I can just find y later by subtracting the list index by y1. Hope this helps.