public static TinhKhoangCach(DIEM A, DIEM B) { double d; d = Math.Sqrt(Math.Pow((A.X - B.X), 2) + Math.Pow((A.Y - B.Y), 2)); return(d); }
public static double TinhKhoangCach(DIEM A, DIEM B) { //Khoang cach 2 diem A va B double d; DIEM A = NhapDiem(); DIEM B = NhapDiem(); d = Math.Sqrt(Math.Pow((A.X - B.X), 2) + Math.Pow((A.Y - B.Y), 2)); Console.WriteLine($"Khoang cach 2 diem A va B la: {d}"); return(d); }
public static double TinhKhoangCach(DIEM diem1, DIEM diem2) { return(Math.Sqrt((diem1.X - diem2.X) * (diem1.X - diem2.X) + (diem1.Y - diem2.Y) * (diem1.Y - diem2.Y))); }