0
$\begingroup$

I have data on many trips (same route). The trip content: latitude, longitude, and time at bus stop. I want to detect the trips that are in the same direction (will have to be two clusters: same direction and opposite direction). Is there an algorithm that can do this?

$\endgroup$
0
$\begingroup$

In way, the algorithm depends on what implementation you want to do specifically.

You have the starting point (X,Y) and ending point (A,B). This forms a vector that has a certain slope, say m. Any vector that is parallel to it has the same slope m and can be considered as going same direction/opposite direction. Same direction can be detected by looking at the sign of the difference between starting/ending co-ordinates.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.