Пример #1
0
        private void mcBtn_Click(object sender, EventArgs e)
        {
            Xtract();
            DuLieuChuanHoa dl = new DuLieuChuanHoa(tongquat, noidung, tacgia, chatluong, trinhbay);

            label1.Text  = dl.TQ + " | " + dl.ND + " | " + dl.TG + " | " + dl.CL + " | " + dl.TB;
            label1.Text += "\n " + dl.evaluate();
        }
Пример #2
0
        public double euclideanDistance(DuLieuChuanHoa data, DuLieuChuanHoa centroid)
        {
            double distance = 0;

            distance += Math.Pow(data.TQ - centroid.TQ, 2);
            distance += Math.Pow(data.ND - centroid.ND, 2);
            distance += Math.Pow(data.TG - centroid.TG, 2);
            distance += Math.Pow(data.CL - centroid.CL, 2);
            distance += Math.Pow(data.TB - centroid.TB, 2);
            distance  = Math.Sqrt(distance);
            return(distance);
        }