#include "circle.h"

/* Are two circles colliding? */
bool
circle_collide(Circle* a, Circle* b)
{
        f32 sum;
        f32 distance;

        distance = DISTANCE_2D
        (
        	a->position[0],
                b->position[0],
        	a->position[1],
                b->position[1]
        );

        sum = a->radius + b->radius;

        if (distance < sum)
                return true;

        return false;
}

/* Determine if a circle contains a point. */
bool
circle_has_point(Circle* self, vec2 point)
{
	f32 distance;

	distance = DISTANCE_2D
	(
		point[0],
		self->position[0],
		point[1],
		self->position[1]
	);

	if (distance <= self->radius)
		return true;

	return false;
}
