lixiaojun
2024-12-10 d7837329e5d2ca8938f4939fa58db2295c7ed88c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using HStation.Model;
 
namespace HStation.Service
{
    /// <summary>
    /// Revit位置拓展
    /// </summary>
    internal static class RevitPositionExtensions
    {
        /// <summary>
        /// 距离
        /// </summary>
        /// <param name="rhs">自身位置</param>
        /// <param name="other">其他位置</param>
        /// <returns></returns>
        public static double Distance(this RevitPosition rhs, RevitPosition other)
        {
            if (rhs == null)
            {
                return default;
            }
            if (other == null)
            {
                return default;
            }
            return Math.Sqrt(Math.Pow(rhs.X - other.X, 2) + Math.Pow(rhs.Y - other.Y, 2) + Math.Pow(rhs.Z - other.Z, 2));
        }
 
    }
}