From bf2ba4604ce8fde9b5e28d9c6201184335163249 Mon Sep 17 00:00:00 2001 From: emanuel Date: Thu, 10 Feb 2022 17:49:28 +0000 Subject: [PATCH] Switch to haversine in DCM intersection check --- src/dcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dcm.c b/src/dcm.c index 3192e49..aad7a86 100644 --- a/src/dcm.c +++ b/src/dcm.c @@ -33,8 +33,8 @@ static int are_vehicles_intersecting( // B2[0] = tB[b+1].latitude; // B2[1] = tB[b+1].longitude; - //if (it2s_tender_do_segments_intersect(A1, A2, B1, B2)) { - if (it2s_tender_is_inside_rectangle(tA[a].latitude, tA[a].longitude, tB[b].latitude, tB[b].longitude, 8, 8, 0, DCM_VINCENTY)) { +// if (it2s_tender_do_segments_intersect(A1, A2, B1, B2)) { + if (it2s_tender_is_inside_rectangle(tA[a].latitude, tA[a].longitude, tB[b].latitude, tB[b].longitude, 8, 8, 0, DCM_HAVERSINE)) { if (tA[a].timestamp < tB[b].timestamp + 2000 && tA[a].timestamp > tB[b].timestamp - 2000) { syslog_info("[facilities] [dc] intersecting @ (%d, %d) in %ld ms", tA[a].latitude, tA[a].longitude, tA[a].timestamp-tA[0].timestamp);