code: def main():
      order = 2
      V, tmp_syms, _ = vandermonde(order)
      print("Vandermonde matrix of order 2 in 1 dimension")
      pprint(V)
  
      print("-" * 79)
      print(
          r"Computing the determinant and comparing to \sum_{0<i<j<=3}(a_j - a_i)"
      )
  
      det_sum = 1
      for j in range(order + 1):
          for i in range(j):
              det_sum *= tmp_syms[j][0] - tmp_syms[i][0]
  
      print(
          r"""
      det(V) = {det}
      \sum   = {sum}
             = {sum_expand}
      """.format(
              det=V.det(),
              sum=det_sum,
              sum_expand=det_sum.expand(),
          )
      )
  
      print("-" * 79)
      print("Polynomial fitting with a Vandermonde Matrix:")
      x, y, z = symbols("x,y,z")
  
      points = [(0, 3), (1, 2), (2, 3)]
      print(
          """
      Quadratic function, represented by 3 points:
         points = {pts}
         f = {f}
      """.format(
              pts=points,
              f=gen_poly(points, 2, [x]),
          )
      )
  
      points = [
          (0, 1, 1),
          (1, 0, 0),
          (1, 1, 0),
          (Rational(1, 2), 0, 0),
          (0, Rational(1, 2), 0),
          (Rational(1, 2), Rational(1, 2), 0),
      ]
      print(
          """
      2D Quadratic function, represented by 6 points:
         points = {pts}
         f = {f}
      """.format(
              pts=points,
              f=gen_poly(points, 2, [x, y]),
          )
      )
  
      points = [(0, 1, 1, 1), (1, 1, 0, 0), (1, 0, 1, 0), (1, 1, 1, 1)]
      print(
          """
      3D linear function, represented by 4 points:
         points = {pts}
         f = {f}
      """.format(
              pts=points,
              f=gen_poly(points, 1, [x, y, z]),
          )
      )
  
imports: from sympy import Matrix, pprint, Rational, symbols, Symbol, zeros
label_desc: Use image node_id 5 for calling a global function with example usage: main() without return types