title: Change from one cartesian 3D co-ordinate system to another by translation and rotation
body: <p>There are two reasons for me to ask this question: </p>
  
  <ol>
  <li>I want to know if my understanding on this issue is correct. </li>
  <li>To clarify a doubt I have. </li>
  </ol>
  
  <p>I want to change the co-ordinate system of a set of points (Old cartesian coordinates system to New cartesian co-ordinate system). This transformation will involve Translation as well as Rotation. This is what I plan to do:</p>
  
  <p><img src="https://i.stack.imgur.com/8jVfY.png" alt="enter image description here"></p>
  
  <p>With respect to this image I have a set of points which are in the XYZ coordinate system (Red). I want to change it with respect to the axes UVW (Purple). In order to do so, I have understood that there are two steps involved: Translation and Rotation.</p>
  
  <p>When I translate, I only change the origin. (say, I want the UVW origin at (5,6,7). Then, for all points in my data, the x co-ordinates will be subtracted by 5, y by 6 and z by 7. By doing so. I get a set of Translated data.) </p>
  
  <p>Now I have to apply a rotation transform (on the Translated data). The Rotation matrix is shown in the image. The values Ux, Uy and Uz are the co-ordinates of a point on the U axis which has unit distance from origin. Similarly, the values Vx, Vy and Vz are the coordinates of a point on the V axis which has a unit distance from origin. (I want to know if I am right here.) Wx, Wy, Wz is calculated as ((normalized u) X (normalised v))</p>
  
  <p>(Also, if it serves any purpose, I would like to let you know that I am using MATLAB.)</p>
  
  <p>edit: </p>
  
  <p>I have a set of 42 points in 3D (42 X 3 matrix <em>A</em>) I want the first point to be considered as origin of <em>UVW</em> plane. So the values of the first point will be my translation vector. Correct?  </p>
  
  <p>Next, to calculate the Rotation vector: According to my requirement, the 6th row of matrix <em>A</em> has to be the <em>U</em> axis while 37th row has to be <em>V</em> axis. Consequently, vector <em>u</em> will be (1st row <em>minus</em> 6th row) of matrix <em>A</em>. While vector <em>v</em> will be (1st row <em>minus</em> 37th row) of matrix <em>A</em>.</p>
  
  <p>The first row of Rotation Matrix will be vector <code>u/|u|</code> (normalized). Second row will be vector <code>v/|v|</code> (v normalized). The third row will be <code>(u X v)</code> . Am I right here?</p>