¾�ΥС�������ʸ�� �� 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9.6 | 9.5 | 9.4 | 9.3 | 9.2 | 9.1 | 9.0 | 8.4 | 8.3 | 8.2 | 8.1 | 8.0 | 7.4 | 7.3 | 7.2

6.9. �����ؿ��ȱ黻��

point (��)��box (���)��lseg��line (��ʬ)��path (ƻ)��polygon (¿�ѷ�)������� circle (��) �����ǡ������ˤϡ�PostgreSQL ���������ݡ��Ȥ��Ƥ���ؿ��ȱ黻�Ҥ�˭�٤�·�äƤ��ޤ� (Table 6-20��Table 6-21������� Table 6-22 ����)��

Table 6-20. Geometric Operators

�黻����������ˡ
+ �¹԰�ưbox '((0,0),(1,1))' + point '(2.0,0)'
- �¹԰�ưbox '((0,0),(1,1))' - point '(2.0,0)'
* �̼�/��žbox '((0,0),(1,1))' * point '(2.0,0)'
/ �̼�/��žbox '((0,0),(2,2))' / point '(2.0,0)'
# ��'((1,-1),(-1,1))' # '((1,1),(-1,-1))'
# ƻ�⤷����¿�ѷ������ο�# '((1,0),(0,1),(-1,0))'
## ������point '(0,0)' ## lseg '((2,0),(0,2))'
&& �Ťʤꡩbox '((0,0),(1.1))' && box '((0,0),(2,2))'
&< ��¦�˽Ťʤꡩbox '((0,0),(1.1))' &< box '((0,0),(2,2))'
&> ��¦�˽Ťʤꡩbox '((0,0),(3,3))' &> box '((0,0),(2,2))'
<-> ��Υcircle '((0,0),1)' <-> circle '((5,0),1)'
<< ����circle '((0,0),1)' << circle '((5,0),1)'
<^ ����circle '((0,0),1)' <^ circle '((0,5),1)'
>> ����circle '((5,0),1)' >> circle '((0,0),1)'
>^ �塩circle '((0,5),1)' >^ circle '((0,0),1)'
?# �򺹤��Ťʤ�lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))'
?- ��ʿ��point '(1,0)' ?- point '(0,0)'
?-| ľ��lseg '((0,0),(0,1))' ?-| lseg '((0,0),(1,0))'
@-@ Ĺ�������뤤�ϱ߼�@-@ path '((0,0),(1,0))'
?| ��ľ��point '(0,1)' ?| point '(0,0)'
?|| �¹ԡ�lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))'
@ ���񡢤��뤤�Ͼ���point '(1,1)' @ circle '((0,0),2)'
@@ �濴@@ circle '((0,0),10)'
~= ������polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))'

Table 6-21. �����ؿ�

�ؿ��֤���������
area(object)double precision (������)���Ǥ�����area(box '((0,0),(1,1))')
box(box, box)box (���)����θ�box(box '((0,0),(1,1))',box '((0.5,0.5),(2,2))')
center(object)point (��ɸ��)���Ǥ��濴center(box '((0,0),(1,2))')
diameter(circle)double precision (������)�ߤ�Ⱦ��diameter(circle '((0,0),2.0)')
height(box)double precision (������)����ι⤵height(box '((0,0),(1,1))')
isclosed(path)boolean (������)�Ĥ���ƻ��isclosed(path '((0,0),(1,1),(2,0))')
isopen(path)boolean (������)������ƻ��isopen(path '[(0,0),(1,1),(2,0)]')
length(object)double precision (������)���Ǥ�Ĺ��length(path '((-1,0),(1,0))')
npoints(path)integer���ο�npoints(path '[(0,0),(1,1),(2,0)]')
npoints(polygon)integer���ο�npoints(polygon '((1,1),(0,0))')
pclose(path)path (ƻ)ƻ���Ĥ����Ѵ�popen(path '[(0,0),(1,1),(2,0)]')
popen(path)path (ƻ)������ƻ���Ѵ�popen(path '((0,0),(1,1),(2,0))')
radius(circle)double precision (������)�ߤ�Ⱦ��radius(circle '((0,0),2.0)')
width(box)double precision (������)��width(box '((0,0),(1,1))')

Table 6-22. �������Ѵ��ؿ�

�ؿ��֤���������
box(circle)box (���)�ߤ�����box(circle '((0,0),2.0)')
box(point, point)box (���)��ɸ���������Ѵ�box(point '(0,0)', point '(1,1)')
box(polygon)box (���)¿�ѷ��������Ѵ�box(polygon '((0,0),(1,1),(2,0))')
circle(box)circle (��)�ߤ��Ѵ�circle(box '((0,0),(1,1))')
circle(point, double precision)circle (��)��ɸ����ߤ��Ѵ�circle(point '(0,0)', 2.0)
lseg(box)lseg (��ʬ)������г����� lseg (��ʬ) ���Ѵ�lseg(box '((-1,0),(1,0))')
lseg(point, point)lseg (��ʬ)��ɸ���� lseg (��ʬ) ���Ѵ�lseg(point '(-1,0)', point '(1,0)')
path(polygon)point (��ɸ��)¿�ѷ���ƻ���Ѵ�path(polygon '((0,0),(1,1),(2,0))')
point(circle)point (��ɸ��)�ߤ��濴point(circle '((0,0),2.0)')
point(lseg, lseg)point (��ɸ��)intersectionpoint(lseg '((-1,0),(1,0))', lseg '((-2,-2),(2,2))')
point(polygon)point (��ɸ��)�ߤ��濴point(polygon '((0,0),(1,1),(2,0))')
polygon(box)polygon (¿�ѷ�)4 �ѷ�polygon(box '((0,0),(1,1))')
polygon(circle)polygon (¿�ѷ�)12 �ѷ�polygon(circle '((0,0),2.0)')
polygon(npts, circle)polygon (¿�ѷ�)npts ¿�ѷ�polygon(12, circle '((0,0),2.0)')
polygon(path)polygon (¿�ѷ�)ƻ����¿�ѷ����Ѵ�polygon(path '((0,0),(1,1),(2,0))')

2 �Ĥι������Ǥ�ʣ���� point �ˡ�ź�� 0��1 ��ͭ��������˥�����������Τ�Ʊ���褦�ˡ������������뤳�Ȥ��Ǥ��ޤ��� ���Ȥ��С�t.p �� point ��ξ�硢SELECT p[0] FROM t �Ȥ������� X ��ɸ������ФǤ��ޤ��� �ޤ���UPDATE t SET p[1] = ... �� Y ��ɸ�����ѹ��Ǥ��ޤ��� Ʊ�ͤˡ�box �ޤ��� lseg �Ǥ⡢2 �Ĥ� point ������Τ褦�˰������Ȥ���ǽ�Ǥ���