#ifndef DISK_H
#define DISK_H

#include <plane.h>
#include <point.h>
#include <typedefs.h>

/*!
\brief A circular disk in 3D space.
*/
class disk
{
public:

  /** Normal or the disks orientation. */
  point3<double> nml;

  /** Position. */
  point3<double> pos;

  /** The circles radius. */
  double radius;

  /** Specify the disk in 3D space. */
  disk
  (
    point3<double> const & nml_,
    point3<double> const & pos_,
    doublec radius_
  );

  /** Find if the two disks intersect, and if so return the first 
      and last intersection points on the line of intersection. */
  boolc intersects
  (
    point3<double> & p0,
    point3<double> & p1,
    disk const & D2
  ) const;

  /** Does this disk intersect with the plane? */
  boolc intersects
  (
    point3<double> & p0,
    point3<double> & p1,
    plane const & w2
  ) const;

  /** Serialize this object by writing it out as a string. */
  operator stringc () const;

};

#endif


