[CSC 435] Testing DOT and MVV

Andrew J. Pounds pounds_aj at mercer.edu
Fri Apr 6 15:42:37 EDT 2018


While I have code in my driver to test VVM, DLS, ILS, and MMM, I do not 
have code in my driver program to test DOT and MVV.  Here are two small 
things you can do to test these...


1. Test DOT by creating a small driver program in which you create two 
arrays.

A⇀=1,2,3,...,N\vec{A}=1,2,3,...,N

B⇀=1,12,13,...,1N\vec{B}=1,\frac{1}{2},\frac{1}{3},...,\frac{1}{N}

and then take the dot product of the two.  It should be equal to N.

2. Test MVV by attempting to rotate a small vector.  Create a 3D array.

A⇀=1,0,0


And then build a matrix that will rotate this vector 90 degree about the 
Z axis.


[cos(π2)-sin(π2)0sin(π2)cos(π2)0001]\begin{bmatrix} 
\cos\left(\frac{\pi}{2}\right) & -\sin\left(\frac{\pi}{2}\right) & 0\\ 
\sin\left(\frac{\pi}{2}\right) & \cos\left(\frac{\pi}{2}\right) & 0 \\ 0 
& 0 & 1 \end{bmatrix}


Multiply A by the matrix and you should get a vector (0,1,0)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://theochem.mercer.edu/pipermail/csc435/attachments/20180406/07f6f7e7/attachment.html>


More information about the csc435 mailing list