The trianglelib C++ API Reference¶
C++ Classes¶
-
class
trianglelib
::
Triangle
¶ Triangle class used for triangle manipulations.
Public Functions
-
Triangle
(const double a, const double b, const double c)¶ Constructor.
Create a new Triangle object from side lengths.
- See
- See
- Parameters
a
: The Length of triangle side a.b
: The Length of triangle side b.c
: The Length of triangle side c.
-
Triangle
(const Triangle &triangle)¶ Copy constructor.
Construct a new Triangle object from another Triangle object.
- See
- See
- Parameters
triangle
: Another Triangle object.
-
double
getSideA
() const¶ Get the length of side a.
- Return
The length of side a.
-
double
getSideB
() const¶ Get the length of side b.
- Return
The length of side b.
-
double
getSideC
() const¶ Get the length of side c.
- Return
The length of side c.
-
std::vector<Triangle>
rotations
() const¶ Get a vector of the Triangle objects whose side lengths have been rotated.
- Return
A vector of Triangle objects.
-
bool
isEquivalent
(const Triangle &triangle) const¶ Determine if the Triangle object is equivalent to the other.
-
bool
isSimilar
(const Triangle &triangle) const¶ Determine if the Triangle object is similar to the other.
-
bool
isEquilateral
() const¶ Determine if the Triangle object is quilateral.
- Return
Whether the Triangle objects is equilateral.
-
bool
isIsosceles
() const¶ Determine if the Triangle object is isosceles.
- Return
Whether the Triangle objects is isosceles.
-
C++ Functions¶
-
Triangle
trianglelib
::
createTriangle
(const double a, const double b, const double c)¶ Create a Triangle object.
- Return
A Triangle object.
- Parameters
a
: The Length of triangle side a.b
: The Length of triangle side b.c
: The Length of triangle side c.