5 -- Back off displayed precision a little bit to reduce platform-to-platform
6 -- variation in results.
7 SET extra_float_digits TO -3;
13 SELECT '' AS four, center(f1) AS center
16 SELECT '' AS four, (@@ f1) AS center
19 SELECT '' AS six, point(f1) AS center
22 SELECT '' AS six, (@@ f1) AS center
25 SELECT '' AS two, (@@ f1) AS center
29 -- "is horizontal" function
30 SELECT '' AS two, p1.f1
32 WHERE ishorizontal(p1.f1, point '(0,0)');
34 -- "is horizontal" operator
35 SELECT '' AS two, p1.f1
37 WHERE p1.f1 ?- point '(0,0)';
39 -- "is vertical" function
40 SELECT '' AS one, p1.f1
42 WHERE isvertical(p1.f1, point '(5.1,34.5)');
44 -- "is vertical" operator
45 SELECT '' AS one, p1.f1
47 WHERE p1.f1 ?| point '(5.1,34.5)';
54 SELECT '' AS count, p.f1, l.s, l.s # p.f1 AS intersection
55 FROM LSEG_TBL l, POINT_TBL p;
58 SELECT '' AS thirty, p.f1, l.s, p.f1 ## l.s AS closest
59 FROM LSEG_TBL l, POINT_TBL p;
69 SELECT '' as six, box(f1) AS box FROM CIRCLE_TBL;
72 SELECT '' AS twentyfour, b.f1 + p.f1 AS translation
73 FROM BOX_TBL b, POINT_TBL p;
75 SELECT '' AS twentyfour, b.f1 - p.f1 AS translation
76 FROM BOX_TBL b, POINT_TBL p;
78 -- scaling and rotation
79 SELECT '' AS twentyfour, b.f1 * p.f1 AS rotation
80 FROM BOX_TBL b, POINT_TBL p;
82 SELECT '' AS twenty, b.f1 / p.f1 AS rotation
83 FROM BOX_TBL b, POINT_TBL p
84 WHERE (p.f1 <-> point '(0,0)') >= 1;
92 SELECT '' AS eight, npoints(f1) AS npoints, f1 AS path FROM PATH_TBL;
94 SELECT '' AS four, path(f1) FROM POLYGON_TBL;
97 SELECT '' AS eight, p1.f1 + point '(10,10)' AS dist_add
100 -- scaling and rotation
101 SELECT '' AS eight, p1.f1 * point '(2,-1)' AS dist_mul
111 SELECT '' AS twentyfour, p.f1, poly.f1, poly.f1 ~ p.f1 AS contains
112 FROM POLYGON_TBL poly, POINT_TBL p;
114 SELECT '' AS twentyfour, p.f1, poly.f1, p.f1 @ poly.f1 AS contained
115 FROM POLYGON_TBL poly, POINT_TBL p;
117 SELECT '' AS four, npoints(f1) AS npoints, f1 AS polygon
120 SELECT '' AS four, polygon(f1)
123 SELECT '' AS four, polygon(f1)
124 FROM PATH_TBL WHERE isclosed(f1);
126 SELECT '' AS four, f1 AS open_path, polygon( pclose(f1)) AS polygon
130 -- convert circles to polygons using the default number of points
131 SELECT '' AS six, polygon(f1)
134 -- convert the circle to an 8-point polygon
135 SELECT '' AS six, polygon(8, f1)
142 SELECT '' AS six, circle(f1, 50.0)
145 SELECT '' AS four, circle(f1)
148 SELECT '' AS two, circle(f1)
152 SELECT '' AS twentyfour, c1.f1 AS circle, p1.f1 AS point, (p1.f1 <-> c1.f1) AS distance
153 FROM CIRCLE_TBL c1, POINT_TBL p1
154 WHERE (p1.f1 <-> c1.f1) > 0
155 ORDER BY distance, circle using <, point using <<;