static void DemoDiemToaDo() { DiemToaDo a = XL_Diem.NhapDiem(); DiemToaDo b = XL_Diem.NhapDiem(); Console.WriteLine($"Khoang cach 2 diem la {XL_Diem.TinhKhoangCach2Diem(a, b)}"); }
public static double TinhChuViDaGiac(DaGiac daGiac) { double ChuVi = 0; if (daGiac.ToaDoCacDinh.Length < 3) { Console.WriteLine("Da giac khong hop le"); return(ChuVi); } for (int i = 0; i < daGiac.ToaDoCacDinh.Length - 1; i++) { ChuVi += XL_Diem.TinhKhoangCach2Diem(daGiac.ToaDoCacDinh[i], daGiac.ToaDoCacDinh[i + 1]); } ChuVi += XL_Diem.TinhKhoangCach2Diem(daGiac.ToaDoCacDinh[0], daGiac.ToaDoCacDinh[daGiac.ToaDoCacDinh.Length - 1]); return(ChuVi); }