I am looking to put the x and y values of the coordinate grid into their own separate arrays in order to perform functions such as Pythagoras etc. Here's my code below.
x1d = np.linspace(-xlen,xlen,res)
y1d = np.linspace(-ylen,ylen,res)
from itertools import product
coordinates = list(product(x1d, y1d))
xcoord = coordinates[:][:][0]
print np.shape(coordinates), np.shape(xcoord), coordinates
I get that the below code will give me
coordinates = [[x1,y1],[x2,y2],...,[xn,yn]].
How would one go about extracting the following arrays?
xcoord = [x1,x2,...,xn]
ycoord = [x1,x2,...,xn]
Is this the right solution for generating a 2D grid of points where I can perform functions upon each individual x,y point, assigning a resultant value to that point?
Thanks!