27 o <<
"*************" << std::endl;
28 o <<
"a_tetrahedron:" << std::endl;
29 o <<
"*************" << std::endl;
30 o <<
"This is a 'tetrahedron' class" << std::endl;
32 o <<
"Create a tetrahedron:" << std::endl;
33 o <<
" a_tetrahedron a" << std::endl;
34 o <<
" a_tetrahedron a p1 p2 p3 p4" << std::endl;
36 o <<
"Commands:" << std::endl;
37 o <<
"p1, p2, p3, p4: get or set apices" << std::endl;
38 o <<
"a[_ref]: returns apex" << std::endl;
39 o <<
"s _ref: returns side of tetrahedron as a_segment" << std::endl;
40 o <<
"f _ref: returns face of tetrahedron as a_triangle" << std::endl;
41 o <<
"c: get centre" << std::endl;
42 o <<
"V: get volume" << std::endl;
43 o <<
"translate _x _y _z: translate." << std::endl;
44 o <<
"rotate _xaxis _yaxis _zaxis: rotate." << std::endl;
52 for (
unsigned short i = 0; i<4; i++)
53 test = test&&(
p_[i]==
p[i]);
59 for (
unsigned short i = 0; i<4; i++)
66 unsigned short r=ref%4;
72 else if (r==1||r==3) v=2;
78 unsigned short r=ref%4;
113 for (
unsigned short i = 0; i<4; i++)
120 for (
unsigned short i = 0; i<4; i++)
121 p_[i].
rotate(x_axis, y_axis, z_axis);
133 for (
unsigned short i = 0; i<4; i++)
140 for (
unsigned short i = 0; i<4; i++)
155 for (
unsigned short i = 0; i<4; i++)
171 for (
unsigned short i = 0; i<4; i++)
177 for (
unsigned short i = 0; i<4; i++)
a_point cross(const a_point &a, const a_point &b)
static const std::string help()
static const std::string help()
a_point c() const
get centre of gravity
virtual void read(std::istream &i)
bool contains(const a_point &p) const
check whether point lies inside triangle
a_point p(const int ref) const
a_segment s(const int ref) const
get segment i (0-3) of tetrahedron
virtual void write(std::ostream &o) const
a_tetrahedron & rotate(const a_point &x_axis, const a_point &y_axis, const a_point &z_axis)
bool operator==(const a_tetrahedron &p)
a_triangle f(const int ref) const
double quality() const
quality: ratio between smaller and bigger segment
double S() const
get surface
a_tetrahedron & operator=(const a_tetrahedron &p)
double V() const
get volume
a_tetrahedron & translate(double x, double y, double z)
void set(const a_point &p1, const a_point &p2, const a_point &p3)
a_point c() const
get centre of gravity