All pastes #26815 Raw Edit

Miscellany

public cpp v1 · immutable
#26815 ·published 2005-10-27 11:14 UTC
rendered paste body
void TForm1::Skaiciuoti(Double D[]) { int t1 = 0;   int t2 = 0;   int t3 = 0;   int l = 0; for (int i = 0; i < a; i++)    for (int j = 0; j < a; j++)      for (int k = 0; k < a; k++) {        abs(t1 = sqrt( pow(X[j] - X[i],2) + pow(Y[j] - Y[i],2)));        abs(t2 = sqrt( pow(X[k] - X[j],2) + pow(Y[k] - Y[j],2)));        abs(t3 = sqrt( pow(X[i] - X[k],2) + pow(Y[i] - Y[k],2)));        if ( (t1*t1 + t2*t2 == t3*t3) && (t3 != 0 )  ) {          T[l] = t1 * t2 / 2;          l++;                    }        if ( (t1*t1 + t3*t3 == t2*t2) && (t2 != 0 ) ) {          T[l] = t1 * t3 / 2;          l++;          }          if ( (t2*t2 + t3*t3 == t1*t1) && (t1 != 0 )  )  {          T[l] = t2 * t3 / 2;          l++;          }  }   }