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

1. ## 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.

2. 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