/** * Retrieve coordinate value from object given coordinate index * @param d WaypointEnvelope object * @param k index of coordinate * * @return Coordinate value */ int operator() ( const TracePoint &d, const unsigned k) const { switch(k) { case 0: return d.get_flatLocation().Longitude; case 1: return d.get_flatLocation().Latitude; }; return 0; };
/** * Calculate approximate squared (flat projected) distance between this point * and another * * @param tp Point to calculate distance to * * @return Approximate squared distance */ gcc_pure unsigned approx_sq_dist(const TracePoint& tp) const { return dsqr(get_flatLocation().Longitude-tp.get_flatLocation().Longitude)+ dsqr(get_flatLocation().Latitude-tp.get_flatLocation().Latitude); }