Calculate vector dot and cross products