Triangle.hh
Go to the documentation of this file.
Triangle< double > Triangled
Double specialization of the Triangle class.
Definition: Triangle.hh:240
bool Valid() const
Get whether this triangle is valid, based on triangle inequality: the sum of the lengths of any two s...
Definition: Triangle.hh:79
T empty(T... args)
Line2< T > Side(const unsigned int _index) const
Get a line segment for one side of the triangle.
Definition: Triangle.hh:94
T Perimeter() const
Get the length of the triangle's perimeter.
Definition: Triangle.hh:202
Triangle(const math::Vector2< T > &_pt1, const math::Vector2< T > &_pt2, const math::Vector2< T > &_pt3)
Constructor.
Definition: Triangle.hh:45
Triangle< float > Trianglef
Float specialization of the Triangle class.
Definition: Triangle.hh:243
double Area() const
Get the area of this triangle.
Definition: Triangle.hh:210
A two dimensional line segment. The line is defined by a start and end point.
Definition: Line2.hh:35
void Set(const unsigned int _index, const math::Vector2< T > &_pt)
Set one vertex of the triangle.
Definition: Triangle.hh:57
T Dot(const Vector2< T > &_v) const
Get the dot product of this vector and _v.
Definition: Vector2.hh:134
math::Vector2< T > operator[](const size_t _index) const
Get one of points that define the triangle.
Definition: Triangle.hh:227
void Set(const math::Vector2< T > &_pt1, const math::Vector2< T > &_pt2, const math::Vector2< T > &_pt3)
Set all vertices of the triangle.
Definition: Triangle.hh:66
Triangle< int > Trianglei
Integer specialization of the Triangle class.
Definition: Triangle.hh:237
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:226
T insert(T... args)
T size(T... args)
STL class.
T begin(T... args)
static const size_t IGN_TWO_SIZE_T
size_t type with a value of 2
Definition: Helpers.hh:232
bool Contains(const math::Vector2< T > &_pt) const
Get whether this triangle contains the given point.
Definition: Triangle.hh:117
bool Contains(const Line2< T > &_line) const
Check if this triangle completely contains the given line segment.
Definition: Triangle.hh:109
Definition: Angle.hh:42
bool Intersects(const Line2< T > &_line, math::Vector2< T > &_ipt1, math::Vector2< T > &_ipt2) const
Get whether the given line intersects this triangle.
Definition: Triangle.hh:147
bool Intersect(const Line2< T > &_line, double _epsilon=1e-6) const
Check if this line intersects the given line segment.
Definition: Line2.hh:180
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:405