#ifndef D3CIRCLEPARTITION
#define D3CIRCLEPARTITION

#include <point.h>
#include <partitionspace.h>

typedef point2<double> pt2;
typedef point2<double> const pt2c;
typedef point3<double> pt3;
typedef point3<double> const pt3c;

class d3circlepartition : public partitionspace<pt3,double>
{
public:

  pt2 x0;
  double radius;

  d3circlepartition()
    : radius(1.0) {}

  d3circlepartition( pt2c _x0, double const _radius )
    : x0(_x0), radius(_radius) {}
  
  bool const isInside(pt3c & x) const
  {
    pt2 z(x.x,x.y);
    z -= x0;
    return z.dot() < radius*radius;
  }

  bool const intersection(pt3 & x, pt3c & w, pt3c & b) const;

  bool const isOnBoundary(pt3c & w, double const zero) const;

};



#endif



