<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 9.11\. 幾何函數和操作符 有許多內置函數和操作符支持幾何類型`point`, `box`, `lseg`, `line`, `path`, `polygon`, `circle`,在[Table 9-30](#calibre_link-1069), [Table 9-31](#calibre_link-2219), [Table 9-32](#calibre_link-2220)中展示。 | **Caution** | |:--- | | 請注意"相同"操作符`~=`表示`point`,`box`, `polygon`,`circle`類型在一般意義上相同。 這些類型有些還有一個`=`操作符,不過它只是比較相同的_面積_。 其它的標量比較操作符(`&lt;=`等)也是為這些類型比較面積。 | **Table 9-30\. 幾何操作符** | 操作符 | 描述 | 例子 | | --- | --- | --- | | `+` | 平移 | `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))'` | | `@-@` | 長度或者周長 | `@-@ path '((0,0),(1,0))'` | | `@@` | 中心 | `@@ circle '((0,0),10)'` | | `##` | 第一個操作數相對第二個操作數的最近點 | `point '(0,0)' ## lseg '((2,0),(0,2))'` | | `&lt;-&gt;` | 間距 | `circle '((0,0),1)' &lt;-&gt; circle '((5,0),1)'` | | `&&` | 重疊?(有一個共同點為真。) | `box '((0,0),(1,1))' && box '((0,0),(2,2))'` | | `&lt;&lt;` | 是否嚴格在左? | `circle '((0,0),1)' &lt;&lt; circle '((5,0),1)'` | | `&gt;&gt;` | 是否嚴格在右? | `circle '((5,0),1)' &gt;&gt; circle '((0,0),1)'` | | `&&lt;` | 是否沒有延伸到右邊? | `box '((0,0),(1,1))' &&lt; box '((0,0),(2,2))'` | | `&&gt;` | 是否沒有延伸到左邊? | `box '((0,0),(3,3))' &&gt; box '((0,0),(2,2))'` | | `&lt;&lt;&#124;` | 嚴格在下? | `box '((0,0),(3,3))' &lt;&lt;&#124; box '((3,4),(5,5))'` | | `&#124;&gt;&gt;` | 嚴格在上? | `box '((3,4),(5,5))' &#124;&gt;&gt; box '((0,0),(3,3))'` | | `&&lt;&#124;` | 沒有延伸到上面? | `box '((0,0),(1,1))' &&lt;&#124; box '((0,0),(2,2))'` | | `&#124;&&gt;` | 沒有延伸到下面? | `box '((0,0),(3,3))' &#124;&&gt; box '((0,0),(2,2))'` | | `&lt;^` | 低于(允許接觸)? | `circle '((0,0),1)' &lt;^ circle '((0,5),1)'` | | `&gt;^` | 高于(允許接觸)? | `circle '((0,5),1)' &gt;^ circle '((0,0),1)'` | | `?#` | 相交? | `lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))'` | | `?-` | 水平? | `?- lseg '((-1,0),(1,0))'` | | `?-` | 水平對齊? | `point '(1,0)' ?- point '(0,0)'` | | `?&#124;` | 豎直? | `?&#124; lseg '((-1,0),(1,0))'` | | `?&#124;` | 豎直對齊? | `point '(0,1)' ?&#124; point '(0,0)'` | | `?-&#124;` | 垂直? | `lseg '((0,0),(0,1))' ?-&#124; lseg '((0,0),(1,0))'` | | `?&#124;&#124;` | 平行? | `lseg '((-1,0),(1,0))' ?&#124;&#124; lseg '((-1,2),(1,2))'` | | `@&gt;` | 包含? | `circle '((0,0),2)' @&gt; point '(1,1)'` | | `&lt;@` | 包含或在...上? | `point '(1,1)' &lt;@ circle '((0,0),2)'` | | `~=` | 與...相同? | `polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))'` | > **Note:** 在PostgreSQL 8.2 之前,包含操作符`@&gt;` 和`&lt;@`被分別稱為`~`和`@`。 我們反對使用這兩個舊名字(當前仍然可以使用),它們將來會被廢除。 **Table 9-31\. 幾何函數** | 函數 | 返回類型 | 描述 | 例子 | | --- | --- | --- | --- | | ``area(```_object_`) | `double precision` | 面積 | `area(box '((0,0),(1,1))')` | | ``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`) | `int` | 點數 | `npoints(path '[(0,0),(1,1),(2,0)]')` | | ``npoints(```polygon`) | `int` | 點數 | `npoints(polygon '((1,1),(0,0))')` | | ``pclose(```path`) | `path` | 把路徑轉換為閉合 | `pclose(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 9-32\. 幾何類型轉換函數** | 函數 | 返回類型 | 描述 | 例子 | | --- | --- | --- | --- | | ``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)` | | ``circle(```polygon`) | `circle` | 將多邊形轉換成圓 | `circle(polygon '((0,0),(1,1),(2,0))')` | | ``lseg(```box`) | `lseg` | 矩形對角線轉化成線段 | `lseg(box '((-1,0),(1,0))')` | | ``lseg(```point`, `point`) | `lseg` | 點轉換成線段 | `lseg(point '(-1,0)', point '(1,0)')` | | ``path(```polygon`) | `path` | 多邊形轉換成路徑 | `path(polygon '((0,0),(1,1),(2,0))')` | | ``point`(``double precision`, `double precision`) | `point` | 結點 | `point(23.4, -44.5)` | | ``point(```box`) | `point` | 矩形的中心 | `point(box '((-1,0),(1,0))')` | | ``point(```circle`) | `point` | 圓心 | `point(circle '((0,0),2.0)')` | | ``point(```lseg`) | `point` | 線段的中心 | `point(lseg '((-1,0),(1,0))')` | | ``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))')` | 我們可以把一個`point`的兩個組成部分當作索引分別為 0 和 1 的數組元素進行訪問。 比如,如果`t.p`是一個`point`字段,那么`SELECT p[0] FROM t` 檢索 X 座標而`UPDATE t SET p[1] = ...`改變 Y 座標。同樣, `box`或`lseg`的值可以當作兩個`point`的數組值看待。 `area`函數可以用于`box`, `circle`, `path`類型。`area`函數操作`path`數據類型的時候, 只有在`path`的點沒有交叉的情況下才可用。比如,`path` `'((0,0),(0,1),(2,1),(2,2),(1,2),(1,0),(0,0))'::PATH`是不行的, 而下面的視覺等效`path` `'((0,0),(0,1),(1,1),(1,2),(2,2),(2,1),(1,1),(1,0),(0,0))'::PATH` 就可以。如果交叉和不交叉的`path`概念讓你糊涂,那么把上面兩個`path` 都畫在紙上,你就明白了。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看