public MyTriangle(MyPoint a, MyPoint b, MyPoint c) { A = a; B = b; C = c; halfPeriment = (A.getDistance(B) + A.getDistance(C) + B.getDistance(C)) / 2; square = Math.Pow((halfPeriment * (halfPeriment - A.getDistance(B)) * (halfPeriment - A.getDistance(C)) * (halfPeriment - B.getDistance(C))), 0.5); }
public bool is_between(MyPoint one, MyPoint two) { double exp1 = getDistance(one) + getDistance(two); double exp2 = one.getDistance(two); double exp3 = exp1 - exp2; if (exp3 < 0) exp3 *= -1; return exp3 < coefficient_error; }