apply2d function

Apply a function to a combination of vectors