// TODO: make this a pure function private void calcWidthsFromZ(FitPeak fit) { double z0, z1, z2, z3, tmp; // wx z0 = (fit.peak.getZCenter() - this.wxZParams[1]) / this.wxZParams[2]; z1 = z0 * z0; z2 = z1 * z0; z3 = z2 * z0; tmp = 1.0 + z1 + this.wxZParams[3] * z2 + this.wxZParams[4] * z3; fit.wxTerm = tmp * tmp; fit.peak.setXWidth(2.0 / (this.wxZParams[0] * tmp)); // wy z0 = (fit.peak.getZCenter() - this.wyZParams[1]) / this.wyZParams[2]; z1 = z0 * z0; z2 = z1 * z0; z3 = z2 * z0; tmp = 1.0 + z1 + this.wyZParams[3] * z2 + this.wyZParams[4] * z3; fit.wyTerm = tmp * tmp; fit.peak.setYWidth(2.0 / (this.wyZParams[0] * tmp)); }