2 #include "PlanesOperations.h"
4 /********************************************************************************************
5 ** Start of data viewmanagerData
6 *********************************************************************************************/
8 PlanesOperations::PlanesOperations()
13 PlanesOperations::~PlanesOperations()
19 double* PlanesOperations::getCrossProduct(double* vect0,double* vect1)
22 vectCross = new double[3];
23 vectCross[0] = vect0[1]*vect1[2]-(vect0[2]*vect1[1]);
24 vectCross[1] = -(vect0[0]*vect1[2]-(vect0[2]*vect1[0]));
25 vectCross[2] = vect0[0]*vect1[1]-(vect0[1]*vect1[0]);
30 ** Returns the magnitud of the given vector
32 double PlanesOperations::getMagnitud(double* vect)
36 mag = sqrt(pow(vect[0],2) + pow(vect[1],2) + pow(vect[2],2));
38 std::cout<<"mag "<<mag <<std::endl;
43 ** returns the unitary vector of the given vector
44 ** u = 1/|vect| . vect
46 double* PlanesOperations::getNormal(double* vect)
50 double mag = getMagnitud(vect);
52 vectnorm = new double[3];
55 vectnorm[0] = vect[0]/mag;
56 vectnorm[1] = vect[1]/mag;
57 vectnorm[2] = vect[2]/mag;
66 double* PlanesOperations::makeVector(double podouble0[3], double podouble1[3])
71 vect[0]= podouble1[0]-podouble0[0];
72 vect[1]= podouble1[1]-podouble0[1];
73 vect[2]= podouble1[2]-podouble0[2];