PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ptarray_scale()

void ptarray_scale ( POINTARRAY pa,
const POINT4D factor 
)

Scale a pointarray.

Definition at line 1851 of file ptarray.c.

References getPoint4d_p(), LWDEBUG, POINT4D::m, POINTARRAY::npoints, ptarray_set_point4d(), POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by lwgeom_scale(), and test_ptarray_scale().

1852 {
1853  int i;
1854  POINT4D p4d;
1855 
1856  LWDEBUG(3, "ptarray_scale start");
1857 
1858  for (i=0; i<pa->npoints; ++i)
1859  {
1860  getPoint4d_p(pa, i, &p4d);
1861  p4d.x *= fact->x;
1862  p4d.y *= fact->y;
1863  p4d.z *= fact->z;
1864  p4d.m *= fact->m;
1865  ptarray_set_point4d(pa, i, &p4d);
1866  }
1867 
1868  LWDEBUG(3, "ptarray_scale end");
1869 
1870 }
void ptarray_set_point4d(POINTARRAY *pa, int n, const POINT4D *p4d)
Definition: lwgeom_api.c:437
double x
Definition: liblwgeom.h:352
double m
Definition: liblwgeom.h:352
int npoints
Definition: liblwgeom.h:371
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
double z
Definition: liblwgeom.h:352
double y
Definition: liblwgeom.h:352
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:122
Here is the call graph for this function:
Here is the caller graph for this function: