33,008
社区成员
发帖
与我相关
我的任务
分享
private static double pow2_estimate(CityPoint p1, CityPoint p2)
{
return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);
}
private static double sqrt_estimate(CityPoint p1,CityPoint p2)
{
return Math.Sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
private static double manhattan_estimate(CityPoint p1, CityPoint p2)
{
return Math.Abs(p1.x - p2.x) + Math.Abs(p1.y - p2.y);
}
private static double max_estimate(CityPoint p1, CityPoint p2)
{
return Math.Max(Math.Abs(p1.x - p2.x), Math.Abs(p1.y - p2.y));
}