source: sasview/src/sas/sascalc/simulation/geoshapespy/tests/testPoint.cc @ 71ac835

Last change on this file since 71ac835 was d85c194, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 9 years ago

Remaining modules refactored

  • Property mode set to 100644
File size: 932 bytes
Line 
1#include <iostream>
2#include <vector>
3#include "Point3D.h"
4
5
6using namespace std;
7
8int main(){
9
10  cout << "test 1:initialize a point, set orientation, set center"
11       << " and perform transform" <<endl;
12  Point3D apoint(3,4,5);
13
14  vector<double> orient(3),center(3);
15  for (int i = 0; i!=3; ++i){
16    center[i] = 0;
17  }
18  orient[0]=10;
19  orient[1]=0;
20  orient[2]=30;
21
22  apoint.Transform(orient,center);
23
24  cout << apoint.getX() <<" "<<apoint.getY()<<" "<<apoint.getZ()<<endl;
25  cout << orient[0] <<" "<<orient[1]<<" "<<orient[2]<<endl;
26
27  cout << "test 2: initialize a point, and perform transformation \n"
28       << "through a rotation matrix and a translation" <<endl;
29
30  vector<double> rotmatrix(9,1);
31  for (size_t i = 0; i != rotmatrix.size(); ++i){
32    cout << rotmatrix[i] <<" ";
33  }
34
35  Point3D pp(1,1,1);
36  pp.TransformMatrix(rotmatrix, center);
37
38  cout << pp.getX() <<" "<<pp.getY()<<" "<<pp.getZ()<<endl;
39  return 0;
40}
Note: See TracBrowser for help on using the repository browser.