MiNeBudemRabami / oop

0 stars 0 forks source link

Замечания по Shapes #2

Open alexey-malov opened 5 years ago

alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 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;
}
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
int main()
{
    vector <string> parametrSet;
    deque <CircleClass> circleSet;
    deque <RectangleClass> rectangleSet;
    deque <TriangleClass> triangleSet;
    deque <LineSegmentClass> lineSegmentSet;
    vector <ShapeInterface*> shapeSet;
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
alexey-malov commented 5 years ago
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));
}
MiNeBudemRabami commented 5 years ago

svg