Name
ST_RotateX — Rotate a geometry rotRadians about the X axis.
Synopsis
geometry ST_RotateX(
geometry geomA, float rotRadians)
;
Description
Rotate a geometry geomA - rotRadians about the X axis.
| |
---|
ST_RotateX(geomA, rotRadians)
is short-hand for ST_Affine(geomA, 1, 0, 0, 0, cos(rotRadians), -sin(rotRadians), 0, sin(rotRadians), cos(rotRadians), 0, 0, 0) .
|
Availability: 1.1.2. Name changed from RotateX to ST_RotateX in 1.2.2
This function supports 3d and will not drop the z-index.
Examples
--Rotate a line 90 degrees along x-axis
SELECT ST_AsEWKT(ST_RotateX(ST_GeomFromEWKT('LINESTRING(1 2 3, 1 1 1)'), pi()/2));
st_asewkt
---------------------------
LINESTRING(1 -3 2,1 -1 1)