30 lines
684 B
C#
30 lines
684 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Assets.Common
|
|
{
|
|
public class Point
|
|
{
|
|
public double x;
|
|
public double y;
|
|
|
|
public Point(double x, double y)
|
|
{
|
|
this.x = x;
|
|
this.y = y;
|
|
}
|
|
|
|
public static double Dist(Point a, Point b)
|
|
{
|
|
return Math.Sqrt(Math.Pow(a.x - b.x, 2) + Math.Pow(a.y - b.y, 2));
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
var hashCode = 1502939027;
|
|
hashCode = hashCode * -1521134295 + x.GetHashCode();
|
|
hashCode = hashCode * -1521134295 + y.GetHashCode();
|
|
return hashCode;
|
|
}
|
|
}
|
|
} |