/// <summary> /// Add the query result from the supplied line to the closest to /// line query object. The accumulated result is returned, or can /// be retrieved as the List property of the query object. /// </summary> public List <IndexDist <double> > GetClosest( ClosestToLineQuery q, TPoint p0, TPoint p1) { var delta = new double[m_dim]; for (int d = 0; d < m_dim; d++) { delta[d] = m_vget(p1, d) - m_vget(p0, d); } q.Init(p0, p1, delta); GetClosestToLine(q, 0); return(q.List); }
/// <summary> /// Create a closest to line query object for a sequence of line /// queries that contribute to a single result. The parameters /// max distance and max count work the same way as in the /// </summary> public ClosestToLineQuery CreateClosestToLineQuery( double maxDistance, int maxCount) { var maxDistPlusEps = maxDistance < double.MaxValue ? maxDistance + m_eps : maxDistance; var q = new ClosestToLineQuery( maxDistance, maxDistPlusEps, maxCount, StaticCreateList(maxCount)) { IndexSet = new DictSet <long>() }; return(q); }