collidex v0.1.0 Collidex.Utils
Assorted utilities and geometric transformations.
Summary
Functions
Convert the numeric parts of arguments to floats. Accepts a single number, a 2-tuple of numbers, or a list of 2-tuples of numbers
Returns a vector normal to each edge of the shape, in a right-handed coordinate space
Given two numeric ranges {a1, a2}, {b1, b2}, returns true if those ranges overlap
Returns the unit-length version of the vector passed as an argument
Functions
Convert the numeric parts of arguments to floats. Accepts a single number, a 2-tuple of numbers, or a list of 2-tuples of numbers.
Examples
iex> Collidex.Utils.coerce_floats [ {1, 3}, {-1.5, -2} ] [ {1.0, 3.0}, {-1.5, -2.0} ]
iex> Collidex.Utils.coerce_floats {1, 3} {1.0, 3.0}
iex> Collidex.Utils.coerce_floats 6 6.0
Returns a vector normal to each edge of the shape, in a right-handed coordinate space.