## 13.6. Geometric Functions

These geometric functions are available for use in formulas in Cartographica. To use them, you must always specify geometry.`function`(`parameters`). For example, to obtain the area of the current geometry (valid only for polygons), you would use `geometry.area()`.

•  `float geometry.area(` useBase`)`;
`[bool useBase]`;

Returns the area in the current coordinate system units, using either the map coordinates (useBase is 0 or not present) or the original layer coordinates (useBase is 1). This function is only available for polygons.
•  `float geometry.length(` useBase`)`;
`[bool useBase]`;

Returns the length in the current coordinate system units, using either the map coordinates (useBase is 0 or not present) or the original layer coordinates (useBase is 1). This function is only available for polygons and lines
•  `float geometry.bbox(` useBase`)`;
`[bool useBase]`;

Returns the rectangle of the bounding box of the current geometry using either the map coordinates (useBase is 0 or not present) or the original layer coordinates (useBase is 1).

The return value is a structure containing x,y,width, and height. To access each individual element, use the dot notation: `geometry.bbox().x` to retrieve the x coordinate, for example.

•  `float geometry.midpoint(` useBase`)`;
`[bool useBase]`;

Returns the midpoint of the line in the current coordinate system, using either the map coordinates (useBase is 0 or not present) or the original layer coordinates (useBase is 1). This function is only available for lines.
•  `float geometry.centroid(` useBase`)`;
`[bool useBase]`;

Returns the centroid of the feature in the current coordinate system, using either the map coordinates (useBase is 0 or not present) or the original layer coordinates (useBase is 1). This function is only for points, multipoints, and polygons.