public void distance_point() { var a = new Point3(1, 2, 5); var b = new Point3(3, 5, 1); var d1 = a.Distance(b); var d2 = b.Distance(a); d1.Should().Be(d2); d1.Should().Be(System.Math.Sqrt(29)); }
/// <summary> /// 计算地图上两点距离 /// </summary> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public float GetHCost(AStarNode3X start, AStarNode3X end) { return(Point3.Distance(start.mapPos, end.mapPos)); }