2 #include "PlanesOperations.h"
4 /********************************************************************************************
5 ** Start of data viewmanagerData
6 *********************************************************************************************/
8 PlanesOperations::PlanesOperations(){
12 PlanesOperations::~PlanesOperations(){
17 double* PlanesOperations::getCrossProduct(double* vect0,double* vect1){
19 vectCross = new double[3];
20 vectCross[0] = vect0[1]*vect1[2]-(vect0[2]*vect1[1]);
21 vectCross[1] = -(vect0[0]*vect1[2]-(vect0[2]*vect1[0]));
22 vectCross[2] = vect0[0]*vect1[1]-(vect0[1]*vect1[0]);
27 ** Returns the magnitud of the given vector
29 double PlanesOperations::getMagnitud(double* vect){
33 mag = sqrt(pow(vect[0],2) + pow(vect[1],2) + pow(vect[2],2));
35 std::cout<<"mag "<<mag <<std::endl;
41 ** returns the unitary vector of the given vector
42 ** u = 1/|vect| . vect
44 double* PlanesOperations::getNormal(double* vect){
47 double mag = getMagnitud(vect);
49 vectnorm = new double[3];
53 vectnorm[0] = vect[0]/mag;
54 vectnorm[1] = vect[1]/mag;
55 vectnorm[2] = vect[2]/mag;
67 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];