# How do I calculate the centroid of a distribution of light?

• December 13th 2007, 12:47 PM
gberz3
How do I calculate the centroid of a distribution of light?
Hi All,

I have a 2 dimensional (X,Y) array of data points (pixels) that represent brightness in a star field. For any given star field I need to be able to pinpoint the center of the distribution of light.

I've found many algorithms regarding the centroid of geometric objects, but I can find none that relate to the distribution of light.

Does anyone know of an algorithm for such a calculation? FYI, I will be implementing this into a computer program so pseudo-code would be just fine.

Best regards.
• December 13th 2007, 10:25 PM
Constatine11
Quote:

Originally Posted by gberz3
Hi All,

I have a 2 dimensional (X,Y) array of data points (pixels) that represent brightness in a star field. For any given star field I need to be able to pinpoint the center of the distribution of light.

I've found many algorithms regarding the centroid of geometric objects, but I can find none that relate to the distribution of light.

Does anyone know of an algorithm for such a calculation? FYI, I will be implementing this into a computer program so pseudo-code would be just fine.

Best regards.

Try:

$\bar{X}=\frac{\sum v(X_i,Y_i) X_i}{\sum v(X_i,Y_i) }$

$\bar{Y}=\frac{\sum v(X_i,Y_i) Y_i}{\sum v(X_i,Y_i) }$

ZB