📄 geometry_1.out
字号:
---- GEOMETRY---- Back off displayed precision a little bit to reduce platform-to-platform-- variation in results.SET extra_float_digits TO -3;---- Points--SELECT '' AS four, center(f1) AS center FROM BOX_TBL; four | center ------+--------- | (1,1) | (2,2) | (2.5,3) | (3,3)(4 rows)SELECT '' AS four, (@@ f1) AS center FROM BOX_TBL; four | center ------+--------- | (1,1) | (2,2) | (2.5,3) | (3,3)(4 rows)SELECT '' AS six, point(f1) AS center FROM CIRCLE_TBL; six | center -----+----------- | (5,1) | (1,2) | (1,3) | (1,2) | (100,200) | (100,1)(6 rows)SELECT '' AS six, (@@ f1) AS center FROM CIRCLE_TBL; six | center -----+----------- | (5,1) | (1,2) | (1,3) | (1,2) | (100,200) | (100,1)(6 rows)SELECT '' AS two, (@@ f1) AS center FROM POLYGON_TBL WHERE (# f1) > 2; two | center -----+------------------------------- | (1.33333333333,1.33333333333) | (2.33333333333,1.33333333333)(2 rows)-- "is horizontal" functionSELECT '' AS two, p1.f1 FROM POINT_TBL p1 WHERE ishorizontal(p1.f1, point '(0,0)'); two | f1 -----+--------- | (0,0) | (-10,0)(2 rows)-- "is horizontal" operatorSELECT '' AS two, p1.f1 FROM POINT_TBL p1 WHERE p1.f1 ?- point '(0,0)'; two | f1 -----+--------- | (0,0) | (-10,0)(2 rows)-- "is vertical" functionSELECT '' AS one, p1.f1 FROM POINT_TBL p1 WHERE isvertical(p1.f1, point '(5.1,34.5)'); one | f1 -----+------------ | (5.1,34.5)(1 row)-- "is vertical" operatorSELECT '' AS one, p1.f1 FROM POINT_TBL p1 WHERE p1.f1 ?| point '(5.1,34.5)'; one | f1 -----+------------ | (5.1,34.5)(1 row)---- Line segments---- intersectionSELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection FROM LSEG_TBL l, POINT_TBL p;ERROR: operator does not exist: lseg # pointHINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.-- closest pointSELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest FROM LSEG_TBL l, POINT_TBL p; thirty | f1 | s | closest --------+------------+-------------------------------+---------------------------------- | (0,0) | [(1,2),(3,4)] | (1,2) | (0,0) | [(0,0),(6,6)] | (0,0) | (0,0) | [(10,-10),(-3,-4)] | (-2.0487804878,-4.43902439024) | (0,0) | [(-1000000,200),(300000,-40)] | (0.00284023658959,15.3846148603) | (0,0) | [(11,22),(33,44)] | (11,22) | (-10,0) | [(1,2),(3,4)] | (1,2) | (-10,0) | [(0,0),(6,6)] | (0,0) | (-10,0) | [(10,-10),(-3,-4)] | (-3,-4) | (-10,0) | [(-1000000,200),(300000,-40)] | (-9.99715942258,15.386461014) | (-10,0) | [(11,22),(33,44)] | (11,22) | (-3,4) | [(1,2),(3,4)] | (1,2) | (-3,4) | [(0,0),(6,6)] | (0.5,0.5) | (-3,4) | [(10,-10),(-3,-4)] | (-3,-4) | (-3,4) | [(-1000000,200),(300000,-40)] | (-2.99789812268,15.3851688427) | (-3,4) | [(11,22),(33,44)] | (11,22) | (5.1,34.5) | [(1,2),(3,4)] | (3,4) | (5.1,34.5) | [(0,0),(6,6)] | (6,6) | (5.1,34.5) | [(10,-10),(-3,-4)] | (-3,-4) | (5.1,34.5) | [(-1000000,200),(300000,-40)] | (5.09647083221,15.3836744977) | (5.1,34.5) | [(11,22),(33,44)] | (14.3,25.3) | (-5,-12) | [(1,2),(3,4)] | (1,2) | (-5,-12) | [(0,0),(6,6)] | (0,0) | (-5,-12) | [(10,-10),(-3,-4)] | (-1.60487804878,-4.64390243902) | (-5,-12) | [(-1000000,200),(300000,-40)] | (-4.99494420846,15.3855375282) | (-5,-12) | [(11,22),(33,44)] | (11,22) | (10,10) | [(1,2),(3,4)] | (3,4) | (10,10) | [(0,0),(6,6)] | (6,6) | (10,10) | [(10,-10),(-3,-4)] | (2.39024390244,-6.48780487805) | (10,10) | [(-1000000,200),(300000,-40)] | (10.000993742,15.3827690473) | (10,10) | [(11,22),(33,44)] | (11,22)(30 rows)---- Lines------ Boxes--SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL; six | box -----+---------------------------------------------------------------- | (7.12132034356,3.12132034356),(2.87867965644,-1.12132034356) | (71.7106781187,72.7106781187),(-69.7106781187,-68.7106781187) | (4.53553390593,6.53553390593),(-2.53553390593,-0.535533905933) | (3.12132034356,4.12132034356),(-1.12132034356,-0.12132034356) | (107.071067812,207.071067812),(92.9289321881,192.928932188) | (181.317279836,82.3172798365),(18.6827201635,-80.3172798365)(6 rows)-- translationSELECT '' AS twentyfour, b.f1 + p.f1 AS translation FROM BOX_TBL b, POINT_TBL p; twentyfour | translation ------------+------------------------- | (2,2),(0,0) | (3,3),(1,1) | (2.5,3.5),(2.5,2.5) | (3,3),(3,3) | (-8,2),(-10,0) | (-7,3),(-9,1) | (-7.5,3.5),(-7.5,2.5) | (-7,3),(-7,3) | (-1,6),(-3,4) | (0,7),(-2,5) | (-0.5,7.5),(-0.5,6.5) | (0,7),(0,7) | (7.1,36.5),(5.1,34.5) | (8.1,37.5),(6.1,35.5) | (7.6,38),(7.6,37) | (8.1,37.5),(8.1,37.5) | (-3,-10),(-5,-12) | (-2,-9),(-4,-11) | (-2.5,-8.5),(-2.5,-9.5) | (-2,-9),(-2,-9) | (12,12),(10,10) | (13,13),(11,11) | (12.5,13.5),(12.5,12.5) | (13,13),(13,13)(24 rows)SELECT '' AS twentyfour, b.f1 - p.f1 AS translation FROM BOX_TBL b, POINT_TBL p; twentyfour | translation ------------+--------------------------- | (2,2),(0,0) | (3,3),(1,1) | (2.5,3.5),(2.5,2.5) | (3,3),(3,3) | (12,2),(10,0) | (13,3),(11,1) | (12.5,3.5),(12.5,2.5) | (13,3),(13,3) | (5,-2),(3,-4) | (6,-1),(4,-3) | (5.5,-0.5),(5.5,-1.5) | (6,-1),(6,-1) | (-3.1,-32.5),(-5.1,-34.5) | (-2.1,-31.5),(-4.1,-33.5) | (-2.6,-31),(-2.6,-32) | (-2.1,-31.5),(-2.1,-31.5) | (7,14),(5,12) | (8,15),(6,13) | (7.5,15.5),(7.5,14.5) | (8,15),(8,15) | (-8,-8),(-10,-10) | (-7,-7),(-9,-9) | (-7.5,-6.5),(-7.5,-7.5) | (-7,-7),(-7,-7)(24 rows)-- scaling and rotationSELECT '' AS twentyfour, b.f1 * p.f1 AS rotation FROM BOX_TBL b, POINT_TBL p; twentyfour | rotation ------------+----------------------------- | (0,0),(0,0) | (0,0),(0,0) | (0,0),(0,0) | (0,0),(0,0) | (0,0),(-20,-20) | (-10,-10),(-30,-30) | (-25,-25),(-25,-35) | (-30,-30),(-30,-30) | (0,2),(-14,0) | (-7,3),(-21,1) | (-17.5,2.5),(-21.5,-0.5) | (-21,3),(-21,3) | (0,79.2),(-58.8,0) | (-29.4,118.8),(-88.2,39.6) | (-73.5,104.1),(-108,99) | (-88.2,118.8),(-88.2,118.8) | (14,0),(0,-34) | (21,-17),(7,-51) | (29.5,-42.5),(17.5,-47.5) | (21,-51),(21,-51) | (0,40),(0,0) | (0,60),(0,20) | (0,60),(-10,50) | (0,60),(0,60)(24 rows)SELECT '' AS twenty, b.f1 / p.f1 AS rotation FROM BOX_TBL b, POINT_TBL p WHERE (p.f1 <-> point '(0,0)') >= 1; twenty | rotation --------+---------------------------------------------------------------------- | (0,0),(-0.2,-0.2) | (-0.1,-0.1),(-0.3,-0.3) | (-0.25,-0.25),(-0.25,-0.35) | (-0.3,-0.3),(-0.3,-0.3) | (0.08,0),(0,-0.56) | (0.12,-0.28),(0.04,-0.84) | (0.26,-0.7),(0.1,-0.82) | (0.12,-0.84),(0.12,-0.84)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -