Name

CG_Rotate2D — Rotates a geometry by a given angle around a specified point in 2D.

Synopsis

geometry CG_Rotate2D(geometry geom, float8 angle, float8 cx, float8 cy);

描述

Rotates the input geometry geom by angle radians around the point (cx, cy). The rotation is performed in 2D space; Z coordinates are dropped. Positive angles rotate the geometry counter-clockwise.

Availability: 3.6.0 - requires SFCGAL >= 2.0.0

该方法需要SFCGAL后端。

示例

SELECT ST_AsText(CG_Rotate2D('POINT(1 0)', pi()/2, 1, 1));
-- Result: POINT(2 1)

相关信息

CG_Rotate, CG_Rotate3D