Consider this course : https://www.scratchapixel.com/lessons/procedural-generation-virtual-worlds/procedural-patterns-noise-part-1/creating-simple-2D-noise . In sub-part Introducing the Concept of Permutation (use CTRL||CMD + F), the author explains Ken Perlin uses the array containing noise values to be interpolated (denoted A) in conjunction with another array, which is the "permutation hash table" (denoted B).
The idea is : from any input (a point), we get its unique noise value in A, using B. A has always 256 cases (whatever the input point's dimension is) : it allows to gain in RAM consumption. B has 512 cases : the 255 first randomly contain numbers from {0...255}, idem for the last half part of B.
How to use the permutation table, according to ScratchAPixel ?
There are 2 things I didn't understand.
First, (1/2) I didn't understand how the hash table is actually used. The workflow I think I understood is the following :
For an input (coordinate), we find the both nearest pre-defined coordinates (i.e. : those present as indices in A). It's a multiple of 255.
The lower one is used to lookup in B
We get a number between [0;255] that we use to lookup in A
We get a number between [0;1] : the noise.
But where is the interpolation between the both pre-defined coordinates' noise values ?
In which way my understanding is wrong ? I believe you should really read this sub-part (Introducing the Concept of Permutation (use CTRL||CMD + F), https://www.scratchapixel.com/lessons/procedural-generation-virtual-worlds/procedural-patterns-noise-part-1/creating-simple-2D-noise), it's very short and maybe your answer would fit my question more than if you were giving me explanations that possibly would be out of the range of those provided by ScratchAPixel. Thus, I would understand your answer better.
By the way, (2/2) I didn't understand this paragraph neither :
You may wonder why the permutation array is twice the size of the function period (512 in size instead of 256). If we deal with a 2D noise, we will first do a lookup in the permutation table using the integer value for the x coordinate of our input point (as described). This will return an integer value in the range [0:255]. We will add the result of this lookup to the integer value for the input point y coordinate and use the sum of these two numbers as an index of the permutation table again. Since the result of the first permutation lookup is in the range [0:255] and that the integer value for the point's y coordinate is also in the range [0:255], it means that the range of possible index value for the permutation table is [0:511]. Hence the size of the permutation array (512).
I'm getting confused by all the different but likely terms ("integer value", "coordinate", ...).