-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
41 lines (33 loc) · 981 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
34
35
36
37
38
39
/*
* main.cpp
*
* Created on: 2017¦~12¤ë26¤é
* Author: Jake
*/
#include <iostream>
#include <typeinfo>
#include "Coord.h"
using namespace std;
int main(){
Coord<float> *c1 = new Coord<float>(0.6, 0.6);
Coord<float> *c2 = new Coord<float>(1.5, 1.5);
Coord<float> *c3 = new Coord<float>(2.8, 0.8);
cout << "c1:\t\t" << *c1;
cout << "c2:\t\t" << *c2;
cout << "c1 + c2:\t" << *c1 + *c2;
cout << "c1 - c2:\t" << *c1 - *c2;
*c1 += *c2;
cout << "c1:\t\t" << *c1;
*c1 -= *c2;
cout << "c1:\t\t" << *c1;
cout << endl;
cout << "c1->getDistance(c2)\t\t" << c1->getDistance(c2) << endl;
cout << "c1->getMDistance(c2)\t\t" << c1->getMDistance(c2) << endl;
cout << "c1->getSlope(c2)\t\t" << c1->getSlope(c2) << endl;
cout << "c1->getTriangleArea(c2, c3)\t" << c1->getTriangleArea(c2, c3) << endl;
cout << "c1->getRadius(c2, c3)\t\t" << c1->getRadius(c2, c3) << endl;
cout << endl;
cout << "convert" << endl;
Coord<int> c4 = *c1;
cout << "c4:\t\t" << c4;
}