## Generated by Codox

# Walkmap 0.1.0-SNAPSHOT

# walkmap.polygon

Essentially the specification for things we shall consider to be polygons.

### centre

`(centre poly)`

TODO: write docs

view source

### check-polygon

#### macro

`(check-polygon o)`

If `o` is not a polygon, throw an `IllegalArgumentException` with an appropriate message; otherwise, returns `o`. Macro, so exception is thrown from the calling function.

view source

### check-polygons

#### macro

`(check-polygons o)`

If `o` is not a sequence of polygons, throw an `IllegalArgumentException` with an appropriate message; otherwise, returns `o`. Macro, so exception is thrown from the calling function.

view source

### check-triangle

#### macro

`(check-triangle o)`

If `o` is not a triangle, throw an `IllegalArgumentException` with an appropriate message; otherwise, returns `o`. Macro, so exception is thrown from the calling function.

view source

### gradient

`(gradient triangle)`

Return a polygon like `triangle` but with a key `:gradient` whose value is a unit vector representing the gradient across `triangle`.

view source

### polygon

`(polygon & vertices)`

Return a polygon constructed from these `vertices`.

view source

### polygon?

`(polygon? o)`

True if `o` satisfies the conditions for a polygon. A polygon shall be a map which has a value for the key `:vertices`, where that value is a sequence of vertices.

view source

### triangle-centre

`(triangle-centre facet)`

Return a canonicalised `facet` (i.e. a triangular polygon) with an added key `:centre` whose value represents the centre of this facet in 3 dimensions. This only works for triangles, so is here not in `walkmap.polygon`. It is an error (although no exception is currently thrown) if the object past is not a triangular polygon.

view source

### triangle?

`(triangle? o)`

True if `o` satisfies the conditions for a triangle. A triangle shall be a polygon with exactly three vertices.

view source