[CSC 315] Transfomation Help
Andrew J. Pounds
pounds_aj at mercer.edu
Wed Oct 14 15:22:11 EDT 2026
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
https://theochem.mercer.edu/csc315
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.
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.
A. (1,2,4)
B. (2,3,5)
C. (1,4,7)
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.
Please note that make this all work properly you have to format the
Mathematica vectors as COLUMN VECTORS and use HOMOGENEOUS COORDINATES.
(121234457111)\left( \begin{array}{ccc} 1 & 2 & 1 \\ 2 & 3 & 4 \\ 4 & 5
& 7 \\ 1 & 1 & 1 \\ \end{array} \right)
The Mathematica example demonstrates how to do this. Please let me know
if you have any questions.
--
*Andrew J. Pounds, Ph.D.*
/Professor of Chemistry and Computer Science/
/Director of the Computational Science Program/
/Mercer University, Macon, GA, 31207 (478) 301-5627 /
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc315/attachments/20261014/0460869b/attachment.htm>
More information about the csc315
mailing list