12345678910111213141516171819202122 |
- #include "Rectangle.h"
- #include <iostream>
- Rectangle::Rectangle(struct Point f, struct Point s, struct Point t, struct Point fo)
- {
- init(f.x, f.y, s.x, s.y, t.x, t.y, fo.x, fo.y);
- }
- double Rectangle::calc_area()
- {
- return l2(x1, y1, x2, y2) * l2(x3, y3, x4, y4);
- }
- double Rectangle::calc_perimiter()
- {
- return l2(x1, y1, x2, y2) * 2 + l2(x3, y3, x4, y4) * 2;
- }
- void Rectangle::name()
- {
- std::cout << "Rectangle" << std::endl;
- }
|