Add tests

This commit is contained in:
DoomzD 2020-06-22 20:38:42 +03:00 committed by Nikita Mikhaylov
parent 23616c773a
commit f7019cf589
18 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1 @@
[[(0,0),(0,5),(5,5),(5,0),(0,0)]]

View File

@ -0,0 +1 @@
select polygonConvexHull([[[(0, 0), (0, 5), (5, 5), (5, 0), (2, 3)]]])

View File

@ -0,0 +1,2 @@
0
1

View File

@ -0,0 +1,2 @@
select polygonsWithin([[[(0, 0),(0, 3),(1, 2.9),(2, 2.6),(2.6, 2),(2.9, 1),(3, 0),(0, 0)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]]);
select polygonsWithin([[[(2, 2), (2, 3), (3, 3), (3, 2)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]])

View File

@ -0,0 +1,2 @@
0
1.2727922061357855

View File

@ -0,0 +1,3 @@
select polygonsDistance([[[(0, 0),(0, 3),(1, 2.9),(2, 2.6),(2.6, 2),(2.9, 1),(3, 0),(0, 0)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]]);
select polygonsDistance([[[(0, 0), (0, 0.1), (0.1, 0.1), (0.1, 0)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]])

View File

@ -0,0 +1,2 @@
0
1

View File

@ -0,0 +1,2 @@
select polygonsEquals([[[(0, 0),(0, 3),(1, 2.9),(2, 2.6),(2.6, 2),(2.9, 1),(3, 0),(0, 0)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]]);
select polygonsEquals([[[(1, 1),(1, 4),(4, 4),(4, 1)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]])

View File

@ -0,0 +1 @@
[[[(1,2.9),(1,1),(2.9,1),(3,0),(0,0),(0,3),(1,2.9)]],[[(1,2.9),(1,4),(4,4),(4,1),(2.9,1),(2.6,2),(2,2.6),(1,2.9)]]]

View File

@ -0,0 +1 @@
select polygonsSymDifference([[[(0, 0),(0, 3),(1, 2.9),(2, 2.6),(2.6, 2),(2.9, 1),(3, 0),(0, 0)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]])

View File

@ -0,0 +1 @@
[[[(1,2.9),(1,4),(4,4),(4,1),(2.9,1),(3,0),(0,0),(0,3),(1,2.9)]]]

View File

@ -0,0 +1 @@
select polygonsUnion([[[(0, 0),(0, 3),(1, 2.9),(2, 2.6),(2.6, 2),(2.9, 1),(3, 0),(0, 0)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]])

View File

@ -0,0 +1 @@
[[[(1,2.9),(2,2.6),(2.6,2),(2.9,1),(1,1),(1,2.9)]]]

View File

@ -0,0 +1 @@
select polygonsIntersection([[[(0, 0),(0, 3),(1, 2.9),(2, 2.6),(2.6, 2),(2.9, 1),(3, 0),(0, 0)]]], [[[(1, 1),(1, 4),(4, 4),(4, 1),(1, 1)]]])

View File

@ -0,0 +1 @@
20

View File

@ -0,0 +1 @@
select polygonPerimeter([[[(0, 0), (0., 5), (5, 5), (5., 0)]]])

View File

@ -0,0 +1 @@
25

View File

@ -0,0 +1 @@
select polygonArea([[[(0, 0), (0., 5), (5, 5), (5., 0)]]])