SortedList <Double, TreePathVertice> GetVerticesInProximalOrder(PointD to) { SortedList <Double, TreePathVertice> list = new SortedList <Double, TreePathVertice>(); foreach (TreePathVertice vertice in _vertices.Values) { Double distance = FlatGeo.GetDistance(vertice.Position, to); while (list.ContainsKey(distance)) { distance += .001; } list.Add(distance, vertice); } return(list); }
PointD FindClosestPointOnOriginalPath(PointD to) { PointD proximal = null; Double shortest = Double.MaxValue; foreach (Line line in m_Lines) { PointD point = line.ClosestPointTo(to); Double distance = FlatGeo.GetDistance(point, to); if (distance < shortest) { shortest = distance; proximal = point; } } return(proximal); }
protected virtual Double GetNativeDistance(PointD p1, PointD p2) { return(FlatGeo.GetDistance(p1 as PointD, p2 as PointD)); }