Finished Magnatude and Direction Function

Finished magnatude and direction function. Now trying to figure out how
to create the mag and dir matrix to pass into the function. Need to over
come issues with memory to make sure there is not memory leak. Looking
like I'll need to use malloc and free.