<!DOCTYPE html>
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Class -- I've tried to put together a couple of documents today
      to help you with the 2D and 3D transformations.  You will find the
      PDF's on my web page</p>
    <p><a class="moz-txt-link-freetext" href="https://theochem.mercer.edu/csc315">https://theochem.mercer.edu/csc315</a></p>
    <p>in the EXAMPLES section.  The two PDF's cover the basics of
      rotations.  You will see reference to an arctan2 function.  The
      normal arctan function will not return consistent results
      depending on the sign of its argument.  This function fixes that. 
       </p>
    <p>I have also included a Mathematica notebook that constructs a
      translation matrix, rotation matrices (about X, Y, and Z axes) and
      a scaling matrix.  I have show in the example how to apply these
      to three points in a 3D space.</p>
    <p>A. (1,2,4)</p>
    <p>B. (2,3,5)</p>
    <p>C. (1,4,7)</p>
    <p>where I have imagined two line segment A-B and A-C.  The
      Mathematica example demonstrates how to translate the two line
      segments so that they start at the origin and then rotate the
      "triangle" made up of the two vectors about the Z-axis (a -45
      degree rotation) so tha the AB line segment then lies in the X-Z
      plane.  I then rotated those points around the Y-Axis (a
      35.2643897degree rotation) so that the AB line segment was
      collinear with the X-Axis.  I stopped there because I ran out of
      time -- but you could also try to rotate the AC line segment into
      the X-Y or X-Z plane.</p>
    <p>Please note that make this all work properly you have to format
      the Mathematica vectors as COLUMN VECTORS and use HOMOGENEOUS
      COORDINATES.</p>
    <p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>(</mo><mtable
              displaystyle="false" rowspacing="0.5ex"
              columnalign="center center center"><mtr><mtd><mn>1</mn></mtd><mtd><mn>2</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd><mn>2</mn></mtd><mtd><mn>3</mn></mtd><mtd><mn>4</mn></mtd></mtr><mtr><mtd><mn>4</mn></mtd><mtd><mn>5</mn></mtd><mtd><mn>7</mn></mtd></mtr><mtr><mtd><mn>1</mn></mtd><mtd><mn>1</mn></mtd><mtd><mn>1</mn></mtd></mtr><mtr><mtd></mtd></mtr></mtable><mo>)</mo></mrow><annotation
            encoding="TeX">\left(
            \begin{array}{ccc} 1 & 2 & 1 \\ 2 & 3 & 4 \\
            4 & 5 & 7 \\ 1 & 1 & 1 \\
            \end{array}
            \right)</annotation></semantics></math></p>
    <p>The Mathematica example demonstrates how to do this.  Please let
      me know if you have any questions.</p>
    <div class="moz-signature">-- <br>
      <b>Andrew J. Pounds, Ph.D.</b><br>
      <i>Professor of Chemistry and Computer Science</i><br>
      <i>Director of the Computational Science Program</i><br>
      <i>Mercer University, Macon, GA, 31207 (478) 301-5627 </i></div>
  </body>
</html>