Answers for "js 1d index to 2d coord"

1

js 1d index to 2d coord

y = index / width;
x = index % width;
Posted by: Guest on May-29-2020
1

how to convert a 2d coordinate to an index

index = x + width * y;
Posted by: Guest on January-07-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language