How to get the resultant of vector by analytical method