Consider the following question:
Two cars A and B start simultaneously from two different cities P and Q respectively and move back and forth between the cities.(As soon as car A reaches city Q it turns and starts for city P and as soon as it reaches city P it leaves for city Q. Similarly for car B) The speeds of the cars A and B are in the ratio of $2:1$ . Find the number of distinct meeting points at which cars A and B can meet.
Now, I know that they will meet in two points. I solved this by dividing the distance between the two cities into 3 segments and then manually finding their common points by the logic that B will travel $1$ unit for every $2$ units A travels.
However, what if the speed ratio was something like $7:9$ or something even more intractable. Manually finding their meeting points would be too lengthy and inelegant. How do I generalize the method to find common points to unwieldy ratios?