Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Shapes / Point.h
blob: acacb85f5317b27f15cdb0583582313f16b85369 (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));
	}
};