26 o <<
"*********" << std::endl;
27 o <<
"a_circle:" << std::endl;
28 o <<
"*********" << std::endl;
29 o <<
"This is a 'circle' class" << std::endl;
31 o <<
"Create a circle:" << std::endl;
32 o <<
" a_point a" << std::endl;
34 o <<
"Commands:" << std::endl;
35 o <<
"centre: get or set centre." << std::endl;
36 o <<
"normal: get or set normal." << std::endl;
37 o <<
"radius: get or set radius." << std::endl;
38 o <<
"p3 _p1 _p2 _p3: set circle passing by 3 points." << std::endl;
39 o <<
"p2 _p1 _p2: move a circle to make it pass by 2 points; keeps radius and normal of original circle." << std::endl;
40 o <<
"length: returns length." << std::endl;
41 o <<
"area: returns area." << std::endl;
42 o <<
"print: prints parameters." << std::endl;
65 if (dir.
norm()==0)
return;
69 this->
radius(((p1-ce).norm()+(
p2-ce).norm()+(
p3-ce).norm())/3.);
75 double b = d.
norm()/2.;
94 o << this->
centre() <<
" ";
95 o << this->
normal() <<
" ";
96 o << this->
radius() <<
" ";
a_point cross(const a_point &a, const a_point &b)
a_point circle_centre(const a_point &p1, const a_point &p2, const a_point &p3)
a_quaternion sqrt(const a_quaternion &x)
a_circle & operator=(const a_circle &v)
static const std::string help()
void p3(const a_point p1, const a_point p2, const a_point p3)
bool operator==(const a_circle &p)
void p2(const a_point p1, const a_point p2)
void normal(const a_point n)
void centre(const a_point c)
virtual void read(std::istream &i)
virtual void write(std::ostream &o) const
static const std::string help()