walkmap.polygon
Essentially the specification for things we shall consider to be polygons.
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.
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.
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.
gradient
(gradient triangle)
Return a polygon like triangle
but with a key :gradient
whose value is a unit vector representing the gradient across triangle
.
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.
rectangle
(rectangle vsw vne)
Return a rectangle, with edges aligned east-west and north-south, whose south-west corner is the vertex vsw
and whose north-east corner is the vertex vne
.
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.
triangle?
(triangle? o)
True if o
satisfies the conditions for a triangle. A triangle shall be a polygon with exactly three vertices.