25 desloc1[i] = p1[i]- p2[i];
26 desloc2[i] = p2[i]-p3[i];
29 REAL norm = inner_product(&aux[0], &aux[3], &aux[0], REAL(0.0));
31 cerr <<
"TPZPlane::SetPlane - Erro: Pontos alinhados nao eh possivel determinar um unico plano\n";
37 matrix[0][1]=p1[(i+1)%3];
39 matrix[1][1]=p2[(i+1)%3];
41 matrix[2][1]=p3[(i+1)%3];
52 matrix[0][1]=p1[(i+1)%3];
54 matrix[1][1]=p2[(i+1)%3];
56 matrix[2][1]=p3[(i+1)%3];
65 matrix2[0][i%3]=vect[0];
66 matrix2[1][i%3]=vect[1];
67 matrix2[2][i%3]=vect[2];
68 matrix2[0][(i+1)%3]=matrix[0][(i+1)%3];
69 matrix2[1][(i+1)%3]=matrix[1][(i+1)%3];
70 matrix2[2][(i+1)%3]=matrix[2][(i+1)%3];
71 matrix2[0][(i+2)%3]=matrix[0][(i+2)%3];
72 matrix2[1][(i+2)%3]=matrix[1][(i+2)%3];
73 matrix2[2][(i+2)%3]=matrix[2][(i+2)%3];
77 fCoef[(ordem[0])%3]=sol[0];
78 fCoef[(ordem[0]+1)%3]=sol[1];
79 fCoef[(ordem[0]+2)%3]= 1.0;
92 aux = aux + ponto[i]*fCoef[i];
95 if(
fabs(aux)<0.000009) {
105 aux = aux + Belongs(ponto1);
106 aux = aux + Belongs(ponto2);
107 aux = aux + Belongs(ponto3);
113 aux1[i]=100.*(ponto1[i]-ponto2[i]);
114 aux2[i]=100.*(ponto2[i]-ponto3[i]);
120 if(
fabs(aux1[i])<0.0000009) aux++;
123 cout <<
"TPZPlane::Belongs(p1, p2, p3) - Warning: Os 3 pontos de entrada estao alinhados\n";
140 aux = aux +(matrix[i%3][0]*matrix[(i+1)%3][1]*matrix[(i+2)%3][2])-(matrix[(i+2)%3][0]*matrix[(i+1)%3][1]*matrix[i%3][2]);
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
int SetPlane(const TPZVec< REAL > &p1, const TPZVec< REAL > &p2, const TPZVec< REAL > &p3)
Computes the equation of the plane from three given points.
TPZSkylMatrix< REAL > matrix
static void ProdVetorial(TPZVec< Tvar > &u, TPZVec< Tvar > &v, TPZVec< Tvar > &result)
Computes the vectorial product u x v.
TPZPlane()
Simple constructor.
static void SortArray3(const TPZVec< Tvar > &array, int ordem[3])
Sorts in descending order, in absolute value and stores the indexes in ordem.
bool Belongs(const TPZVec< REAL > &point)
Check whether the point belongs at the plane.
Contains declaration of the TPZPlane class which implements a plane.
void MatrixDet(REAL matrix[3][3], REAL &det)