private void CalcularMedia() { double resultX = 0, resultY = 0; foreach (double valor in ValoresX) { resultX += valor; } this.Med_x = (ValoresX.Count() == 0)? 0 : resultX / ValoresX.Count(); foreach (double valor in ValoresY) { resultY += valor; } this.Med_Y = (ValoresY.Count() == 0) ? 0 : resultY / ValoresY.Count(); }
private void CalcularDesvioPadrao() { double resultX = 0, resultY = 0; foreach (double valor in ValoresX) { resultX += Math.Pow((valor - this.Med_x), 2); } this.DesvioP_x = (ValoresX.Count() == 0) ? 0 : Math.Sqrt(resultX / ValoresX.Count()); foreach (double valor in ValoresY) { resultY += Math.Pow((valor - this.Med_Y), 2); } this.DesvioP_Y = (ValoresY.Count() == 0) ? 0 : Math.Sqrt(resultY / ValoresY.Count()); }