#include <PlanesOperations.h>
Public Member Functions | |
PlanesOperations () | |
~PlanesOperations () | |
double * | getCrossProduct (double *vect0, double *vect1) |
double | getPodoubleProduct (double *vect0, double *vect1) |
double * | getNormal (double *vect) |
double | getMagnitud (double *vect) |
double * | makeVector (double podouble0[3], double podouble1[3]) |
Definition at line 8 of file PlanesOperations.h.
PlanesOperations::PlanesOperations | ( | ) |
PlanesOperations::~PlanesOperations | ( | ) |
double * PlanesOperations::getCrossProduct | ( | double * | vect0, | |
double * | vect1 | |||
) |
Definition at line 17 of file PlanesOperations.cxx.
Referenced by PlaneDirectionManagerData::UpdateActor().
00017 { 00018 double* vectCross; 00019 vectCross = new double[3]; 00020 vectCross[0] = vect0[1]*vect1[2]-(vect0[2]*vect1[1]); 00021 vectCross[1] = -(vect0[0]*vect1[2]-(vect0[2]*vect1[0])); 00022 vectCross[2] = vect0[0]*vect1[1]-(vect0[1]*vect1[0]); 00023 00024 return vectCross; 00025 }
double PlanesOperations::getPodoubleProduct | ( | double * | vect0, | |
double * | vect1 | |||
) |
double * PlanesOperations::getNormal | ( | double * | vect | ) |
returns the unitary vector of the given vector u = 1/|vect| . vect
Definition at line 44 of file PlanesOperations.cxx.
References getMagnitud().
Referenced by PlaneDirectionManagerData::UpdateActor().
00044 { 00045 00046 double* vectnorm; 00047 double mag = getMagnitud(vect); 00048 00049 vectnorm = new double[3]; 00050 00051 00052 if(mag!=0){ 00053 vectnorm[0] = vect[0]/mag; 00054 vectnorm[1] = vect[1]/mag; 00055 vectnorm[2] = vect[2]/mag; 00056 }else{ 00057 vectnorm[0] = 0; 00058 vectnorm[1] = 0; 00059 vectnorm[2] = 0; 00060 } 00061 00062 return vectnorm; 00063 00064 00065 }
double PlanesOperations::getMagnitud | ( | double * | vect | ) |
Returns the magnitud of the given vector
Definition at line 29 of file PlanesOperations.cxx.
Referenced by getNormal().
00029 { 00030 00031 double mag; 00032 00033 mag = sqrt(pow(vect[0],2) + pow(vect[1],2) + pow(vect[2],2)); 00034 00035 std::cout<<"mag "<<mag <<std::endl; 00036 00037 return mag; 00038 00039 }
double * PlanesOperations::makeVector | ( | double | podouble0[3], | |
double | podouble1[3] | |||
) |
Definition at line 67 of file PlanesOperations.cxx.
Referenced by PlaneDirectionManagerData::UpdateActor().
00067 { 00068 double *vect; 00069 vect = new double[3]; 00070 00071 vect[0]= podouble1[0]-podouble0[0]; 00072 vect[1]= podouble1[1]-podouble0[1]; 00073 vect[2]= podouble1[2]-podouble0[2]; 00074 00075 return vect; 00076 00077 }