Javascript quadtrite

I worked in jQuery and I was given this code for quadtree in javascript:

map = array(
    array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4)),
    array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4)),
    array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4)),
    array(array(1,2,3,4), array(1,2,3,4), array(1,2,3,4), array(1,2,3,4))
);

map[0][3][3] = "END OF ARRAY 1";
map[1][3][3] = "END OF ARRAY 2";

However, it just looks like a 3d array to me, am I stupid? ^. ^

+3
source share
2 answers

So technically this is a quadrant, but that’s not what most people would expect if you said “here is some quadrice code.”

Quadtree code usually means a class that handles building such a tree by inserting objects with 2D coordinates, and then finding intersecting or close objects.

eg. see http://www.mikechambers.com/blog/2011/03/21/javascript-quadtree-implementation/

+1
source

, . , .

+6

Source: https://habr.com/ru/post/1756322/


All Articles