Skip to content

Commit 3535a47

Browse files
committed
Merge branch 'master' of github.com:j05u3/spatial-hash-table
2 parents 9b54c69 + c712f22 commit 3535a47

File tree

1 file changed

+36
-59
lines changed

1 file changed

+36
-59
lines changed

README.md

Lines changed: 36 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -28,66 +28,43 @@ $b->addElement(new Edge(new Point(1.75, 1.75), new Point( 1.75, 1.25), 300));
2828
$b->addElement(new Point(0.5, 0.5, 400));
2929

3030

31-
var_dump($b->getAllElementsInCircle(new Point(0,0)));
32-
/**
33-
array(3) {
34-
[100]=>
35-
object(SpatialHashTable\SupportedGeometries\Edge)#3 (3) {
36-
["id"]=>
37-
int(100)
38-
["p1"]=>
39-
object(SpatialHashTable\SupportedGeometries\Point)#10 (3) {
40-
["id"]=>
41-
int(0)
42-
["x"]=>
43-
float(-1.5)
44-
["y"]=>
45-
float(-1)
46-
}
47-
["p2"]=>
48-
object(SpatialHashTable\SupportedGeometries\Point)#5 (3) {
49-
["id"]=>
50-
int(0)
51-
["x"]=>
52-
float(-0.5)
53-
["y"]=>
54-
float(-0.5)
55-
}
56-
}
57-
[200]=>
58-
object(SpatialHashTable\SupportedGeometries\Edge)#9 (3) {
59-
["id"]=>
60-
int(200)
61-
["p1"]=>
62-
object(SpatialHashTable\SupportedGeometries\Point)#8 (3) {
63-
["id"]=>
64-
int(0)
65-
["x"]=>
66-
float(1.25)
67-
["y"]=>
68-
float(1.5)
31+
echo json_encode($b->getAllElementsInCircle(new Point(0,0)));
32+
33+
```
34+
And the output is:
35+
36+
```json
37+
{
38+
"100": {
39+
"id": 100,
40+
"p1": {
41+
"id": 0,
42+
"x": -1.5,
43+
"y": -1
44+
},
45+
"p2": {
46+
"id": 0,
47+
"x": -0.5,
48+
"y": -0.5
6949
}
70-
["p2"]=>
71-
object(SpatialHashTable\SupportedGeometries\Point)#4 (3) {
72-
["id"]=>
73-
int(0)
74-
["x"]=>
75-
float(0.5)
76-
["y"]=>
77-
float(0.75)
50+
},
51+
"200": {
52+
"id": 200,
53+
"p1": {
54+
"id": 0,
55+
"x": 1.25,
56+
"y": 1.5
57+
},
58+
"p2": {
59+
"id": 0,
60+
"x": 0.5,
61+
"y": 0.75
7862
}
79-
}
80-
[400]=>
81-
object(SpatialHashTable\SupportedGeometries\Point)#12 (3) {
82-
["id"]=>
83-
int(400)
84-
["x"]=>
85-
float(0.5)
86-
["y"]=>
87-
float(0.5)
63+
},
64+
"400": {
65+
"id": 400,
66+
"x": 0.5,
67+
"y": 0.5
8868
}
8969
}
90-
91-
**/
92-
93-
```
70+
```

0 commit comments

Comments
 (0)