apply map in multiple dimension
I have a this list
ver1=[(0.00,0.50,0.75),(0.00,−0.50,0.75),(0.50,0.75,0.00),(0.50,−0.75,0.00)]
I want apply the function f(x,y, z)
say 0.3*ver[0][0]+ 0.7*ver[1][0]+ 0.2*ver[2][0]
to each 3-tuple of this function. I know that map do it but the exemples are for for only one variable not for 3.
I have tried to transform ver1 in matrix but after I do not know how to proceed. Perhaps it is not possible ?
Do you mean you are considering the function
f(x, y, z) = 0.3*x + 0.7*y + 0.2*z
and you have a listver
of 3-tuples and you want the list off(x, y, z)
for each(x, y, z)
in the listver
?Is
ver
the same asver1
?Instead of
0.3*ver[0][0]+ 0.7*ver[1][0]+ 0.2*ver[2][0]
do you mean0.3*ver[0][0]+ 0.7*ver[0][1]+ 0.2*ver[0][2]
?