Triangle[ GAMB | Source | Keywords | Summary | Ancestors | All Members | Descendants ]
| public: | |
| Triangle(); | |
| Triangle(const Vector3& a,const Vector3& b,const Vector3& c); | |
| Triangle(const Triangle& tr); | |
| Triangle& | operator=(const Triangle& tr); |
| Vector3 | baricenter() const; |
| Triangle | operator+(const Vector3& vec) const; |
| RigidTrans3 | operator|(const Triangle& tr) const |
| static float | area(const Vector3& a,const Vector3& b,const Vector3& c); |
| static Vector3 | sideLengths(const Vector3& a,const Vector3& b,const Vector3& c); |
| protected: |
Copyright: SAMBA group, Tel-Aviv Univ. Israel, 2001.
A new triangle may be constructed with 3 3D vectors - one for each vertix of triangle
Vector3 v_A(1.0, 2.0, 3.0);
Vector3 v_B(1.0, 5.0, 1.0);
Vector3 v_C(0.0, 2.5, 2.0);
triangle tr(v_A, v_B, v_C);
You may calculate the baricenter of given triangle:
Vector3 baricenter = tr.Baricenter();
Shifting of triangle:
triangle tr2 = tr + Vector3(1.0,1.0,1.0);
And finally the calculation of 3D transformation of two triangles, assuming they can be fit
RigidTrans3 rt3 = tr | tr2;
cout << "The transformation is: " << rt3;
Triangle();
Default constructor
Triangle();
Triangle(const Vector3& a,const Vector3& b,const Vector3& c);
Constructor with vertices initialization
Triangle(const Vector3& a,const Vector3& b,const Vector3& c);
Triangle(const Triangle& tr);
Copy constructor
Triangle(const Triangle& tr);
Triangle& operator=(const Triangle& tr);
Assignment operator
Triangle& operator=(const Triangle& tr);
Vector3 baricenter() const;
Calculates the Baricenter of the triangle
We assume that every vertix of triangle has
the same weight (1)
Vector3 baricenter() const;
Triangle operator+(const Vector3& vec) const;
Calculates a shift of Baricenter of triangle (add vector)
(doesn't change the object itself)
Triangle operator+(const Vector3& vec) const;
RigidTrans3 operator|(const Triangle& tr) const
Returns a transformation to fit triangle tr onto
this triangle
RigidTrans3 operator|(const Triangle& tr) const
float area(const Vector3& a,const Vector3& b,const Vector3& c);
returns area of triangle formed by a b c
static float area(const Vector3& a,const Vector3& b,const Vector3& c);
Vector3 sideLengths(const Vector3& a,const Vector3& b,const Vector3& c);
returns side lengths of triangle formed by a b c
static Vector3 sideLengths(const Vector3& a,const Vector3& b,const Vector3& c);
| public: | ||
|---|---|---|
| Triangle& | operator=(const Triangle& tr); | |
| Vector3 | baricenter() const; | |
| Triangle | operator+(const Vector3& vec) const; | |
| RigidTrans3 | operator|(const Triangle& tr) const | |
| static float | area(const Vector3& a,const Vector3& b,const Vector3& c); | |
| static Vector3 | sideLengths(const Vector3& a,const Vector3& b,const Vector3& c); | |
| protected: | ||
Report problems to jkotula@unimax.com