Add `dotProduct` method to vector