< docs jsFiddle >

# geometry functions

This example appends a few Points, LineStrings, and Polygons. It then calculates some relationships and info about the shapes using the geometry functions in the $.geo namespace. The red box is the bbox of all red shapes.

| distance
pt, pt |
pt, line |
pt, poly |
line, pt |
line, line |
line, poly |
poly, pt |
poly, line |
poly, poly |

| contains
pt, pt |
pt, line |
pt, poly |
line, pt |
line, line |
line, poly |
poly, pt |
poly, line |
poly, poly |

| contains
poly, pt |
poly, line |
poly, poly |
poly, poly |

| centroid
pt |
line |
poly |
poly |
poly |