Here is the explanation for the preceding code:
- def curv2rect_tr(x, y) defines the function that converts curvilinear coordinates into rectilinear co-ordinates. It retains x in the new coordinates, but y in rectilinear coordinates is defined as y - x:
- x, y = np.asarray(x), np.asarray(y) redefines input parameters x and y to NumPy arrays.
- Maps curvilinear coordinates to rectilinear coordinates, x = x (same value in both systems), and y in rectilinear system = y - x of the curvilinear system.
- def rect2curv_tr(x, y) defines the function that converts rectilinear coordinates to curvilinear coordinates. It is the inverse of the curv2rect function.
- grid_helper = GridHelperCurveLinear((curv2rect_tr, rect2curv_tr)) defines a helper ...