#pragma once

#include <memory>
#include <cmath>

class Point
{
public:

    Point(double x, double y);

    ~Point();

    std::shared_ptr<Point> Create(double x, double y);

    double GetX() const
    {
        return mX;
    }

    double GetY() const
    {
        return mY;
    }

    double GetDistance(const Point& point) const
    {
        return std::sqrt(mX*point.GetX() + mY*point.GetY());
    }

    double GetDeltaX(const Point& point) const
    {
        return point.GetX() - mX;
    }

    double GetDeltaY(const Point& point) const
    {
        return point.GetY() - mY;
    }

private:

    double mX;
    double mY;
};

using PointPtr = std::shared_ptr<Point>;
