Website Summary Files Commits Branches @commit @diff @stats
path: root / Classes / Triangle / point.hpp
blob: a8a2c19f5b0d5e420ecfda5bc7712efee52786b8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

struct Point
{
	Point()
	{
		x = 0;
		y = 0;
	}
	Point(int x, int y)
	{
		this->x = x;
		this->y = y;
	}
	double DistTo(const Point& other)
	{
		int dx = x - other.x;
		int dy = y - other.y;
		return sqrt(dx*dx + dy*dy);
	}
	int x;
	int y;
};