public double GetDistance(Point p) { if ((this.Type != PointType.None || p.Type != PointType.None) && this.Type != p.Type) throw new NotSupportedException("不支持这项操作"); if (this.Type == PointType.None) { return Math.Sqrt((p.X - this.X) * (p.X - this.X) - (p.Y - this.Y) * (p.Y - this.Y)); } else { var p1 = this.ToWgsPoint(); var p2 = p.ToWgsPoint(); return distance(p1, p2); } }
public double GetDistance(Point p) { if ((this.Type != PointType.None || p.Type != PointType.None) && this.Type != p.Type) { throw new NotSupportedException("不支持这项操作"); } if (this.Type == PointType.None) { return(Math.Sqrt((p.X - this.X) * (p.X - this.X) - (p.Y - this.Y) * (p.Y - this.Y))); } else { var p1 = this.ToWgsPoint(); var p2 = p.ToWgsPoint(); return(distance(p1, p2)); } }