-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The Flaw:
The function calculates the distance between coordinates, but the arguments are passed to haversine_distance in the wrong order, causing nonsensical calculations.
Function definition expects: (lat1, lon1, lat2, lon2)
def haversine_distance(lat1, lon1, lat2, lon2): ...
Function call inside create_order:
distance_km = haversine_distance(
order.source_lat,
order.dest_lat, # <--- Should be dest_lon
order.source_lon, # <--- Should be source_lon (if 2nd arg was correct)
order.dest_lon
)
Why it breaks the system:
It is passing Dest Latitude as the second argument where Source Longitude is expected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels