collidex v0.2.0 Collidex.Detection.Circles

Detect collisions (or not) between pairs of circles

Summary

Functions

Check for a collision between two circles c1 and c2. Return value is truthy if the two circles overlap on the plane

Functions

collision?(c1, c2)

Check for a collision between two circles c1 and c2. Return value is truthy if the two circles overlap on the plane.

Examples

iex> Collidex.Detection.Circles.collision?(
...>   Collidex.Geometry.Circle.make(0.0, 0.0, 1.0),
...>   Collidex.Geometry.Circle.make(1.0, 1.0, 1.0)
...> )
{ :collision, {-1.0, -1.0} }

iex> Collidex.Detection.Circles.collision?(
...>   Collidex.Geometry.Circle.make(0.0, 0.0, 1.0),
...>   Collidex.Geometry.Circle.make(3.0, 3.0, 1.0)
...> )
false