chunky v0.13.0 Chunky.Geometry View Source
Functions for working with geometric shapes, patterns, and surfaces.
This module contains high level operations and guards for working with geometry.
See specific modules for more in depth functions:
Chunky.Geometry.Triangle
- Manipulate and measure trianglesChunky.Geometry.Triangle.Predicates
- Assess properties of triangles
Guards
is_triangle?/1
- Is the given parameter a 3-tuple of positive integers greater than0
?
Shape tests
is_valid_triangle?/1
- Is the given triangle a valid shape?
Link to this section Summary
Link to this section Functions
Is the shape of the given triangle valid?
The is_triangle?/1
guard can only test for a limited set of properties. This function applies
an additional set of constraints.
Examples
iex> Geometry.is_valid_triangle?({3, 4, 5})
true
iex> Geometry.is_valid_triangle?({5, 5, 5})
true
iex> Geometry.is_valid_triangle?({3, 4, 7})
false
iex> Geometry.is_valid_triangle?({10, 20, 40})
false