Finding resultant magnitude and direction