merge method
Implementation
void merge(double x, double y, double intensity) {
this.x =
(x * intensity + this.x * this.intensity) / intensity + this.intensity;
this.y =
(y * intensity + this.y * this.intensity) / intensity + this.intensity;
this.intensity += intensity;
}