+void PlanesOperations::addVectors(double* vect0, double* vect1, double*vectres){
+
+ vectres[0]= vect0[0] + vect1[0];
+ vectres[1]= vect0[1] + vect1[1];
+ vectres[2]= vect0[2] + vect1[2];
+}
+
+void PlanesOperations::scalarVector(double* vect0, double scalar, double*vectres){
+
+ vectres[0]= vect0[0]*scalar;
+ vectres[1]= vect0[1]*scalar;
+ vectres[2]= vect0[2]*scalar;
+}
+
+vector<double> PlanesOperations::getCrossProduct(vector<double> vect0,vector<double> vect1){
+
+ vector<double> vectCross;
+
+ for(unsigned i = 0; i < vect0.size(); i++){
+
+ unsigned ii = (i + 1 == vect0.size())? 0: i + 1;
+ unsigned iii = (ii + 1 == vect0.size())? 0: ii + 1;
+
+ vectCross.push_back( vect0[ii]*vect1[iii]- vect0[iii]*vect1[ii] );
+
+ }
+ return vectCross;
+
+}
+double PlanesOperations::getDotProduct(vector<double> vect0,vector<double> vect1){
+
+ double sum = 0;
+
+ for(unsigned i = 0; i < vect0.size(); i++) sum += vect0[i]*vect1[i];
+
+ return sum;
+}
+vector<double> PlanesOperations::getNormal(vector<double> vect){
+ vector<double> vectnorm;
+ double mag = getMagnitud(vect);
+
+ for(unsigned i = 0; i < vect.size(); i++){
+
+ if(mag != 0){
+ vectnorm.push_back(vect[i]/mag);
+ }else{
+ vectnorm.push_back(0);
+ }
+ }
+ return vectnorm;
+}
+double PlanesOperations::getMagnitud(vector<double> vect){
+ double mag = 0;
+
+ for(unsigned i = 0; i < vect.size(); i++) mag += pow(vect[i], 2);
+
+ mag = sqrt(mag);
+
+ //std::cout<<"mag "<<mag <<std::endl;
+
+ return mag;
+}
+vector<double> PlanesOperations::makeVector(vector<double> podouble0, vector<double> podouble1){
+
+ vector<double> vector;
+
+ for(unsigned i = 0; i < podouble0.size(); i++){
+ vector.push_back(podouble1[i] - podouble0[i]);
+ }
+ return vector;
+}
+
+/**
+* Adds to vectors, the result is in vectres;
+*@param double* vect0, the first vector
+*@param double* vect1, the second vector
+*@param double* vectres, the resulting vector
+*/
+vector<double> PlanesOperations::addVectors(vector<double> vect0, vector<double> vect1){
+ vector<double> vectres;
+ for(unsigned i = 0; i < vect0.size(); i++){
+ vectres.push_back(vect0[i] + vect1[i]);
+ }
+ return vectres;
+}
+
+/**
+* multiply a vector with a given scalar
+*@param double* vect0, the vector
+*@param double scalar, the scalar value
+*@param double* vectres, the resulting vector
+*/
+vector<double> PlanesOperations::scalarVector(vector<double> vect0, double scalar){
+ vector<double> vectres;
+ for(unsigned i = 0; i < vect0.size(); i++){
+ vectres.push_back(vect0[i]*scalar);
+ }
+ return vectres;
+}
+