private void mergeCentroid(Star s, int weight){
final int size = size();
final int coeffSum = size + weight;
//Merge coordinates
EquatorialCoordinates cCoordinates = centroid.getCoodinates();
EquatorialCoordinates sCoordinates = s.getCoodinates();
double alpha = cCoordinates.getAscention() * size + sCoordinates.getAscention() * weight;
alpha /= coeffSum;
double delta = cCoordinates.getDeclinaison() * size + sCoordinates.getDeclinaison() * weight;
delta /= coeffSum;
//Merge magnitude
double magnitude = centroid.getMagnitude() * size + s.getMagnitude() * weight;
magnitude /= coeffSum;
//Merge color
Color sColor = s.getColor();
int red = centroid.getColor().getRed()*size + sColor.getRed()*weight;
red /= coeffSum;
int green = centroid.getColor().getGreen()*size + sColor.getGreen()*weight;
green /= coeffSum;
int blue = centroid.getColor().getBlue()*size + sColor.getBlue()*weight;
blue /= coeffSum;
//TODO define a special spectral type
this.centroid = new Star("centroid", new EquatorialCoordinates(alpha, delta), magnitude, new Color(red, green, blue));
}