Skip to content

/

功能描述

收缩/旋转,将第一个参数的每个点除以第二个POINT。适用于POINT、BOX、PATH、CIRCLE。

说明:

  • 将点视为由实部和虚部表示的复数,并执行标准的复数除法。
  • 如果将第二个POINT解释为向量,等价于将对象的大小和到原点的距离按向量的长度缩放,并以向量与X轴的夹角绕原点顺时针旋转。

数据类型

L_OPERAND_TYP(左操作数类型)R_OPERAND_TYP(右操作数类型)RET_TYPE(返回类型)
POINTPOINTPOINT
BOXPOINTBOX
PATHPOINTPATH
CIRCLEPOINTCIRCLE

示例

  • POINT

    sql
    SELECT POINT('(2.0,0)') / POINT('(0,2.0)');
    EXPR1     |
    ----------+
    (0.0,-1.0)|
  • BOX

    sql
    SELECT BOX(POINT('(0,1)'),POINT('(1,0)')) / POINT('(0,2.0)');
    EXPR1               |
    --------------------+
    (0.5,0.0),(0.0,-0.5)|
  • PATH

    sql
    SELECT PATH('((0,0),(1,0),(1,1))') / POINT('(2.0,0)');
    EXPR1                          |
    -------------------------------+
    ((0.0,0.0),(0.5,0.0),(0.5,0.5))|
    
    SELECT PATH('((0,0),(1,0),(1,1))') / POINT(cosd(45), sind(45));
    EXPR1                                                                        |
    -----------------------------------------------------------------------------+
    ((0.0,0.0),(0.7071067811865476,-0.7071067811865476),(1.4142135623730951,0.0))|
  • CIRCLE

    sql
    SELECT CIRCLE('<(3,4),2>') / POINT('(1,2)');
    EXPR1                          |
    -------------------------------+
    <(2.2,-0.4),0.8944271909999159>|