#include <triangle.h>
Inheritance diagram for Triangle:
Public Member Functions | |
Triangle (int b, int h, int x, int y) | |
Triangle (int b, int h, Point c) | |
virtual std::string | getType () const |
virtual double | getArea () const |
Triangle::Triangle | ( | int | b, | |
int | h, | |||
int | x, | |||
int | y | |||
) |
Overloaded constructor that takes in a base, a height and an (x,y) coordinate.
b | The base of the triangle (must be greater than 0) | |
h | The height of the triangle (must be greater than 0) | |
x | The X coordinate of the triangle's center point in 2D space | |
y | The Y coordinate of the triangle's center point in 2D space |
Triangle::Triangle | ( | int | b, | |
int | h, | |||
Point | c | |||
) |
Overloaded constructor that takes in a base, a height, and a center Point.
b | The base of the triangle (must be greater than 0) | |
h | The height of the triangle (must be greater than 0) | |
c | The center point of the triangle in 2D space |
string Triangle::getType | ( | ) | const [virtual] |
double Triangle::getArea | ( | ) | const [virtual] |