Switch to haversine in DCM intersection check

This commit is contained in:
emanuel 2022-02-10 17:49:28 +00:00
parent 148eb02636
commit bf2ba4604c
1 changed files with 2 additions and 2 deletions

View File

@ -34,7 +34,7 @@ static int are_vehicles_intersecting(
// 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_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);