Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2. #include "BrokenLine.h"
  3. #include "implementation.cpp"
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. BrokenLine l;
  10. l.add(Point(0, 0));
  11. l.add(Point(0, 1));
  12. l.add(Point(1, 1));
  13. l.add(Point(1, 0));
  14. for (int i = 0; i < l.size(); i++)
  15. cout << '(' << l.getPoint(i).x << ", " << l.getPoint(i).y << ")\n";
  16. cout << "Size: " << l.size() << "\nSplit()\n";
  17. l.split(0.5);
  18. for (int i = 0; i < l.size(); i++)
  19. std::cout << '(' << l.getPoint(i).x << ", " << l.getPoint(i).y << ")\n";
  20. std::cout << "Size: " << l.size() << std::endl;
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement