16 #ifndef _A_TRIANGLE_H_
17 #define _A_TRIANGLE_H_
37 virtual const std::string
classname() {
return "a_triangle";}
38 static const std::string
help();
44 inline a_point p(
const int i)
const {
if (i==0)
return p1_;
if (i==1)
return p2_;
if (i==2)
return p3_; exit(1);}
95 virtual void read(std::istream &i);
96 virtual void write(std::ostream &o)
const;
a_triangle(const a_point &p1, const a_point &p2, const a_point &p3)
a_triangle(const a_triangle &p)
void p2(const a_point &v)
a_triangle & rotate(const a_point &x_axis, const a_point &y_axis, const a_point &z_axis)
double max_edge() const
length of longest segment
static const std::string help()
void p3(const a_point &v)
a_point p(const int i) const
virtual void read(std::istream &i)
bool operator==(const a_triangle &p)
virtual void write(std::ostream &o) const
a_point operator[](const int i) const
a_triangle & operator=(const a_triangle &p)
bool contains(const a_point &p) const
check whether point lies inside triangle
a_segment s(const int ref) const
get segment i (0-2) of triangle
a_triangle shape() const
triangle with same shape but with centre of gravity at origin
a_point closest(const a_point &p) const
triangle point closest to p
virtual const std::string classname()
a_segment s2() const
get second segment of triangle
void set(const a_point &p1, const a_point &p2, const a_point &p3)
a_segment s1() const
get first segment of triangle
a_mat_sq inertia() const
inertia of the triangle 3x3 matrix
double quality() const
quality: ratio between smaller and bigger segment
void p1(const a_point &v)
a_point c() const
get centre of gravity
double min_edge() const
length of smallest segment
a_segment s3() const
get third segment of triangle
a_segment intersect(const a_segment &s) const
intersection of triangle with a segment
a_triangle & translate(double x, double y, double z)
double distp(const a_point &p) const
distance between p and plane defined by triangle
a_mat_sq coord() const
cordinates of the triangle as a 3x3 matrix
double dist(const a_point &p) const
distance between p and triangle
a_point closestp(const a_point &p) const
point of plane defined by triangle closest to p