collidex v0.1.0 Collidex.Geometry.Circle

Struct to represent perfect circles.

Summary

Functions

Return the center of the circle as an {x,y} 2-tuple

Make a circle. All numbers are coerced to floats. Accepts any of: • A tuple of three values: center x, center y, radius. * Three arguments: center x, center y, radius

Functions

center(circle)

Return the center of the circle as an {x,y} 2-tuple

make(arg)

Make a circle. All numbers are coerced to floats. Accepts any of: • A tuple of three values: center x, center y, radius. * Three arguments: center x, center y, radius

Examples

iex> Collidex.Geometry.Circle.make({5,5,0.75}) %Collidex.Geometry.Circle{center: { 5.0, 5.0}, radius: 0.75}

iex> Collidex.Geometry.Circle.make(2,1,0.5) %Collidex.Geometry.Circle{center: {2.0, 1.0}, radius: 0.500}

make(x, y, r)