-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
33 lines (26 loc) · 811 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
using namespace std;
#include "polygon.h"
#include "vertex.h"
int main()
{
Vertex varr[] = { Vertex(0,0), Vertex(6,0),
Vertex(6,6), Vertex(0,6) };
Polygon pol( varr, 4 );
cout << "num: " << pol.numVertices() << endl;
cout << "yta: " << pol.area() << endl;
cout << "minx: " << pol.minx() << endl;
cout << "maxx: " << pol.maxx() << endl;
cout << "miny: " << pol.miny() << endl;
cout << "maxy: " << pol.maxy() << endl;
pol.add( Vertex(-1,3) );
cout << "num: " << pol.numVertices() << endl;
cout << "yta: " << pol.area() << endl;
cout << "minx: " << pol.minx() << endl;
Polygon pol1;
pol1.add( Vertex(0,0) );
pol1.add( Vertex(3,3) );
pol1.add( Vertex(3,0) );
cout << "triangelyta: " << pol1.area() << endl;
return 0;
}