14 lines
294 B
C++
14 lines
294 B
C++
|
//
|
||
|
// Created by Marcus Vinícius de Carvalho
|
||
|
//
|
||
|
|
||
|
#include "Triangle.h"
|
||
|
|
||
|
Triangle::Triangle(string name, const float width, const float height)
|
||
|
: Polygon(std::move(name), width, height) {
|
||
|
polytype = POLY_TRIANGLE;
|
||
|
}
|
||
|
|
||
|
float Triangle::calculateArea() {
|
||
|
return width * height * 0.5f;
|
||
|
}
|