Path Center Correction So I have groups of (x,y) coordinates that I'm using to draw lines.  The lines aren't perfectly straight but they are connected.

In a Cartesian plane the middle would be called the origin, but I'm working with a digital image processing program, so the coordinate (0,0) is at the top left of the image.

What I'm trying to do is translate all of the coordinates in each line (group of coordinates) the same distance, so that the first point in each line starts at the middle of the image.

Here is an example of what I want:



Here is what I have:
1) Group of points: $\{ (x_{i},y_{i})\}_{i=1..n}$

2) Centroid of the group of points: $\left(\frac{1}{n} \sum^{n}_{i=1}x_{i},\frac{1}{n}\sum^{n}_{i=1}y_{i} \right)$.

3) Center of the image: $(x_{c},y_{c})$

4) Translation of arbitrary point $(x,y)$ to the center $(x_{c},y_{c})$: $t(x,y)=(x_{c}-x,y_{c}-y)$

Note that $(x,y)+t(x,y) = (x_{c},y_{c})$ ...

Now just substitute 2) in 4) and you have your formula to translate the centroid to the image center. Right?

I am sure that I am missing something here - the translation distance obviously cannot be kept the same for all points. Didn't you mean another type of transform (maybe scaling have to be included as well) ?