Answer the question
In order to leave comments, you need to log in
[[+content_image]]
How to find the nearest element in a 2D array?
Hello!
I have an array (matrix) of points 0 and 1 of the form (schematically, because the real matrix is much larger):
[[0,0,0,0,0,0,1,0,0],
[0,1,0,0,0,0,0,0,0],
[0,0,0,1,0,0,0,1,0],
[0,0,0,0,0,0,0,0,0],
[0,0,1,0,0,0,0,0,0]]
[3,4]
Answer the question
In order to leave comments, you need to log in
find non-empty element closest to point coordinates
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question