您的位置:首页 > 其它

实现 计算两个三维坐标点的 距离

2017-07-06 12:12 309 查看
internal class Vector3
{
float x;
float y;
float z;
public Vector3(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}

internal static double Distance(Vector3 startAirportPos, Vector3 endAirportPos)
{
double sqrt = System.Math.Sqrt(System.Math.Pow(startAirportPos.x - endAirportPos.x, 2) + System.Math.Pow(startAirportPos.y - endAirportPos.y, 2) + System.Math.Pow(startAirportPos.z - endAirportPos.z, 2));
return System.Math.Abs(sqrt);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: