# function returns point(s) on a straight line joining the element end points: # Ao * PHIo(X) + A1 * PHI1(X) at point(s) X def points(x,x0,x1,a0,a1): # function to return the line or a point within an element # x is a point or list of points, x0,x1, are the x value edges of the element, # a0,a1 are the 'y' values of the 'f' function at the element edges temp = (x - x0)/(x1 - x0) # note that x can be a list of numbers return a0*(1-temp) + a1*temp # can return a list, if x is a list