public double KhoangCach(ThanhPho tp) { double KC = Math.Pow((this.ToaDo.X - tp.ToaDo.X), 2); KC += Math.Pow((this.ToaDo.Y - tp.ToaDo.Y), 2); KC = Math.Sqrt(KC); return(KC); }
public ConKien(ThanhPho tpXuatPhat, int id) { DSThanhPhoChuaQua = new List <ThanhPho>(); ThanhPhoXuatPhat = tpXuatPhat; ThanhPhoHienTai = tpXuatPhat; TongDuongDi = 0; HanhTrinh = new List <ThanhPho>(); HanhTrinh.Add(tpXuatPhat); ID = id; }
public static List <ThanhPho> KhoiTaoThanhPho(List <Point> MangToaDo) { List <ThanhPho> KetQua = new List <ThanhPho>(); int i = 0; ThanhPho tp; foreach (var pt in MangToaDo) { tp = new ThanhPho(pt, i.ToString(), i); KetQua.Add(tp); i++; } return(KetQua); }