source: sasview/realSpaceModeling/geoshapespy/tests/testPoint.cc @ 309a1f0

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since 309a1f0 was f2d6445, checked in by Mathieu Doucet <doucetm@…>, 17 years ago

moving realSpaceModeling to trunk

  • Property mode set to 100644
File size: 932 bytes
RevLine 
[f2d6445]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.