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

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);
    }
}

    原文作者:1990Scarlett
    原文地址: https://blog.csdn.net/chuan403082010/article/details/74532299
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞