calculating dot product
add vector for 2D space