Example

Scale a Polygon Horizontally

geometric.polygonScaleX(polygon, scale[, origin]) returns the vertices resulting from scaling the horizontal coordinates of a polygon by a scaleFactor (where 1 is the polygon's current size) from an origin point. The vertical coordinates remain unchanged. If origin is not specified, the origin defaults to the polygon's centroid.

The returned polygon's area is equal to the input polygon's area multiplied by the scaleFactor.

Adjust the scale factor to see polygonScaleX resize the polygon horizontally from its centroid.

See also Polygon Scale Y.

Code