# Last edited on 2021-07-31 15:28:15 by jstolfi from gauss_bell import gauss_bell from basis_sample import basis_sample def basis_2d_gauss_sample(c, r, s): # Evaluats at the sample points {s} the Gauss bell basis functions whose # centroids are in {c} and whose radii are in {r}. # # Both the centroid and radius of each basis element must be a 2-tuple of floats. # # Returns a list {B} of {nf} lists, each element being a list of # {ns=len(s)} floats; such that {B[i][k]} is the 2d Gauss bell basis # element with centroid {c[i]} and radius {r[i]} evaluated at the point {s[k]}. nb = len(c); def basis_gauss(i, p): cxi,cyi = c[i] rxi,ryi = r[i] gx = gauss_bell((p[0]-cxi)/rxi) gy = gauss_bell((p[1]-cyi)/ryi) Bp = gx*gy return Bp; # ...................................................................... B = basis_sample(nb, basis_gauss, s); return B # ----------------------------------------------------------------------