/* * Ham khoi tao khong tham so * Dinh A,B,C deu co toa do 0,0 */ public TamGiac() { _a = new Diem(0, 0); _b = new Diem(0, 0); _c = new Diem(0, 0); }
/* * Ham khoi tao 3 tham so Diem * Dinh A,B,C bang 3 tham so */ public TamGiac(Diem a, Diem b, Diem c) { _a = a; _b = b; _c = c; }
/* * Ham tinh khoang cach den 1 diem khac * Ham tra ve gia tri khoang cach */ public double KhoangCach(Diem d) { double kc = Math.Sqrt((this._x - d._x) * (this._x - d._x) + (this._y - d._y) * (this._y - d._y)); return(kc); }