Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Point.h
blob: f00b37d52ada46046dbbb85b405b06ce978d2f62 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#pragma once
#include <iostream>
struct Point
{
	int x;
	int y;
	Point(int x, int y)
	{
		this->x = x;
		this->y = y;
	}
	Point() : Point(0,0)
	{}
	double getDist(const Point& other) const
	{
		return sqrt((x - other.x)*(x - other.x) + (y - other.y) * (y - other.y));
	}
};