#include "Circle.h"

Circle::Circle(const Point& centre, double radius)
    :   mRadius(radius),
        mCentre(centre)

{
    mMinorRadius = mRadius;
}

const Point& Circle::getLocation() const
{
    return mCentre;
}

double Circle::getRadius() const
{
    return mRadius;
}

double Circle::getMinorRadius() const
{
    return mMinorRadius;
}

void Circle::setMinorRadius(double radius)
{
    mMinorRadius = radius;
}

void Circle::sample(SparseGrid<bool>*) const
{

}

bool Circle::isEllipse() const
{
    return mRadius != mMinorRadius;
}

Bounds Circle::getBounds() const
{
    double minX = mCentre.getX() - mRadius;
    double maxX = mCentre.getX() + mRadius;
    double minY = mCentre.getY() - mMinorRadius;
    double maxY = mCentre.getY() + mMinorRadius;
    return { minX, maxX, minY, maxY };
}

Circle::Type Circle::getType() const
{
    return Type::CIRCLE;
}
