How could I generate the following list of points using some function or mapping without using the table function.
x = (1 - Cos[# Pi])/2 & /@ Range[0, 1, 0.1];
y = (1 - Cos[# Pi])/2 & /@ Range[0, 1, 0.1];
nx = Length[x];
ny = Length[y];
nodesElement =
Flatten[Table[{{x[[i]], y[[j]]}, {x[[i + 1]], y[[j]]}, {x[[i + 1]],
y[[j + 1]]}, {x[[i]], y[[j + 1]]}}, {j, 1, ny - 1}, {i, 1,
nx - 1}], 1];
I am interested in more pure functional programming
Flatten[Outer[{y, x} |-> {{x[[1]], y[[1]]}, {x[[2]], y[[1]]}, {x[[2]], y[[2]]}, {x[[1]], y[[2]]}}, Partition[y, 2, 1], Partition[x, 2, 1], 1], 1]
$\endgroup$Tuples
instead of a custom function—or maybe there's a slicker way I'm not thinking of! $\endgroup$