working magnitude,direction pair vectorization