Question: Mapping a function of two variables

Hello,

I have a question on the efficient usage of map command.

 

Suppose I have a function of two variables:

a:=(x,y)->sin(x)*cos(y)

 

I would like to evaluate the function using fixed values of x and y (i.e. grid search problem):

f:=x->x*Pi/180

X:=f(<seq(0..360,45)>)

Y:=f(<seq(0..360,60)>)

 

I have found how to do this one variable at a time:

map(a,X,Y[1]); map(a,X,Y[2]) etc.

map2(a,X[1],Y); map2(a,X[2],Y) etc.

 

But is there an efficient way to perform evaluation of a using x and y from the X and Y sequence?

Ideally, for the output I would like an X by Y matrix that would contain the a values in it.

 

Thank you in advance!

Please Wait...