Open alexey-malov opened 5 years ago
double TriangleClass::getPerimetr() const
{
double side1 = sqrt((vertex2.x - vertex1.x)*(vertex2.x - vertex1.x) + (vertex2.y - vertex1.y)*(vertex2.y - vertex1.y));
double side2 = sqrt((vertex3.x - vertex2.x)*(vertex3.x - vertex2.x) + (vertex3.y - vertex2.y)*(vertex3.y - vertex2.y));
double side3 = sqrt((vertex3.x - vertex1.x)*(vertex3.x - vertex1.x) + (vertex3.y - vertex1.y)*(vertex3.y - vertex1.y));
return side1 + side2 + side3;
}
int main()
{
vector <string> parametrSet;
deque <CircleClass> circleSet;
deque <RectangleClass> rectangleSet;
deque <TriangleClass> triangleSet;
deque <LineSegmentClass> lineSegmentSet;
vector <ShapeInterface*> shapeSet;
double Triangle::GetLength(Point v1, Point v2) const
{
return sqrt((v2.x - v1.x)*(v2.x - v1.x) + (v2.y - v1.y)*(v2.y - v1.y));
}
svg