Professional Documents
Culture Documents
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace cshw2
{
internal class Point
{
public int x;
public int y;
}
}
public double DistanceFrom(Point p)
{
int x_dist = this.x - p.x;
int y_dist = this.y - p.y;
return Math.Sqrt((x_dist)^2 + (y_dist)^2);
}
public double DistanceFromOrigin()
{
return Math.Sqrt(x * x + y * y);
}
}