Circle2D.hpp

A class to manage circles in a 2D plane.

Typedefs

using Circle = Circle2D<double>
template<typename TYPE = double>
class Circle2D
#include <Circle2D.hpp>

Public Functions

inline constexpr Circle2D(const Point2D<TYPE> &_c, TYPE _r = 0)
inline constexpr Circle2D(TYPE _x, TYPE _y, TYPE _r = 0)
inline constexpr Circle2D(TYPE _r = 0)
inline constexpr const Point2D<TYPE> &GetCenter() const
inline constexpr TYPE GetCenterX() const
inline constexpr TYPE GetCenterY() const
inline constexpr TYPE GetRadius() const
inline constexpr TYPE GetSquareRadius() const
inline Circle2D<TYPE> &SetCenter(const Point2D<TYPE> &c)
inline Circle2D<TYPE> &SetCenter(TYPE x, TYPE y)
inline Circle2D<TYPE> &SetCenterX(TYPE x)
inline Circle2D<TYPE> &SetCenterY(TYPE y)
inline Circle2D<TYPE> &SetRadius(TYPE new_radius)
inline Circle2D<TYPE> &Set(const Point2D<TYPE> &c, TYPE r)
inline Circle2D<TYPE> &Set(TYPE x, TYPE y, TYPE r)
inline Circle2D<TYPE> &Translate(Point2D<TYPE> shift)
inline constexpr bool Contains(const Point2D<TYPE> &point) const
inline constexpr bool Contains(TYPE x, TYPE y) const
inline constexpr bool Contains(const Circle2D<TYPE> &other) const
inline bool HasOverlap(const Circle2D<TYPE> &other) const

Private Members

Point2D<TYPE> center
TYPE radius