# shortest distance between a series of points

by J-son

(Virginia)

I have two series of equally spaced points. They both have the same number of points N, but they do not start at the same point and one series is equally spaced by some value D1, while the other is equally spaced by some value D2. What is the shortest nonzero distance between two points in this combined series of points?

graphical example:

Series 1 -> parameters are D1 = 4, x1 = 2, and N = 7

. . . . . . .

the Series 1 equation is y

**n1** = x1 + n1*D1 = 2 + n1*4, where n1 is an integer value that goes from 0 to N

Series 2 -> parameters are D2 = 7, x2 = 4, and N = 7

x x x x x x x

the Series 2 equation is y

**n2** = x2 + n2*D2 = 4 + n2*7, where n2 is an integer value that goes from 0 to N

If I combine them, how do I calculate the shortest nonzero distance "-" between points "x" and "."?

.-x--.----x----.--x-.----.x---.---x x x