]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/kernel/PlanesOperations.cxx
Diego Caceres: creaButtonContainer and creaPanelButtonContainer has been added to...
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / PlanesOperations.cxx
index 001f2722e1f6a0f1c1422dcb910f5cf94e60915e..b0c7ebd797257cd7abf1452e1ae4c30f71c0ef98 100644 (file)
@@ -5,16 +5,19 @@
 ** Start of data viewmanagerData
 *********************************************************************************************/
 
-PlanesOperations::PlanesOperations(){  
+PlanesOperations::PlanesOperations()
+{      
 }
 
 
-PlanesOperations::~PlanesOperations(){
+PlanesOperations::~PlanesOperations()
+{
 
 }
 
 
-double* PlanesOperations::getCrossProduct(double* vect0,double* vect1){
+double* PlanesOperations::getCrossProduct(double* vect0,double* vect1)
+{
        double* vectCross;
        vectCross = new double[3];
        vectCross[0] = vect0[1]*vect1[2]-(vect0[2]*vect1[1]);
@@ -26,29 +29,28 @@ double* PlanesOperations::getCrossProduct(double* vect0,double* vect1){
 /**
 **     Returns the magnitud of the given vector
 **/
-double PlanesOperations::getMagnitud(double* vect){
-
+double PlanesOperations::getMagnitud(double* vect)
+{
        double mag;
 
        mag = sqrt(pow(vect[0],2) + pow(vect[1],2) + pow(vect[2],2));
 
-       std::cout<<"mag "<<mag <<std::endl;
+       //std::cout<<"mag "<<mag <<std::endl;
 
        return mag;
-
 }
 /**
 **     returns the unitary vector of the given vector
 **     u = 1/|vect| . vect
 **/
-double* PlanesOperations::getNormal(double* vect){
+double* PlanesOperations::getNormal(double* vect)
+{
 
        double* vectnorm;
        double mag = getMagnitud(vect);
 
        vectnorm = new double[3];
        
-
        if(mag!=0){
                vectnorm[0] = vect[0]/mag;
                vectnorm[1] = vect[1]/mag;
@@ -58,13 +60,11 @@ double* PlanesOperations::getNormal(double* vect){
                vectnorm[1] = 0;
                vectnorm[2] = 0;
        }
-
        return vectnorm;
-
-
 }
 
-double* PlanesOperations::makeVector(double podouble0[3], double podouble1[3]){
+double* PlanesOperations::makeVector(double podouble0[3], double podouble1[3])
+{
        double *vect;
        vect = new double[3];
 
@@ -73,5 +73,9 @@ double* PlanesOperations::makeVector(double podouble0[3], double podouble1[3]){
        vect[2]= podouble1[2]-podouble0[2];
 
        return vect;
+}
+
+double PlanesOperations::getDotProduct(double* vect0,double* vect1){
+       return vect0[0]*vect1[0] + vect0[1]*vect1[1] + vect0[2]*vect1[2];
+}
 
-}
\ No newline at end of file