Code Documentation

class base.Foundation[source]

This class contains common features of all modules.

DetSymEnv()[source]

Returns a list. The list consists of all symbolic tools present among ‘sympy’,’sage’ and ‘symengine’.

class interpolation.Interpolation(var, env='sympy')[source]

The Interpolation class provides polynomial interpolation routines in multi variate case.

var is the list of symbolic variables and env is the the symbolic tool.

Delta(idx=-1)[source]

Construct the matrix corresponding to idx’th point, if idx>0 Otherwise returns the discriminant.

Interpolate(points, vals)[source]

Takes a list of points points and corresponding list of values vals and return the interpolant.

Since in multivariate case, there is a constraint on the number of points, it checks for the valididty of the input. In case of failure, describes the type of error occured according to the inputs.

MinNumPoints()[source]

Returns the minimum number of points still required.

Monomials()[source]

Generates the minimal set of monomials for interpolation.

class graphics.Graphics(env='numeric', numpoints=50)[source]

This class tends to provide basic graphic tools based on matplotlib and mayavi.

Accepts one optional argument env which determines the types of the function to be visualized:

  • numeric: is a numerical function (regular python functions)
  • sympy: Sympy symbolic function
  • sage: Sage symbolic function
ParamPlot2D(funcs, rng, color='blue', legend='', thickness=1)[source]

Appends a parametric curve to the Graphics object. The parameters are as follows:

  • funcs: the tupleof functions to be plotted,
  • rng: a triple of the form (t, a, b), where t is the funcs’s independents variable, over the range [a, b],
  • color: the color of the current curve,
  • legend: the text for the legend of the current crve.
Plot2D(func, xrng, color='blue', legend='', thickness=1)[source]

Appends a curve to the Graphics object. The parameters are as follows:

  • func: the function to be plotted,
  • xrng: a triple of the form (x, a, b), where x is the func’s independents variable, over the range [a, b],
  • color: the color of the current curve,
  • legend: the text for the legend of the current crve.
Plot3D(func, xrng, yrng)[source]

Sets a surface to the Graphics object. The parameters are as follows:

  • func: the function to be plotted,
  • xrng: a triple of the form (x, a, b), where x is the first func`s independents variable, over the range `[a, b],
  • yrng: a triple of the form (y, c, d), where x is the second func’s independents variable, over the range [c, d].
Point(pnts, color='blue', marker='o', legend='')[source]

Adds a list of points to the plot.

SetLabelX(lbl)[source]

Sets the label for X axis

SetLabelY(lbl)[source]

Sets the label for Y axis

SetLabelZ(lbl)[source]

Sets the label for Z axis

SetTitle(ttl)[source]

Sets the title of the graph.

interact()[source]

Shows an interavtive demo of the 3D surface, using mayavi, so it requires mayavi for python to be installed.

save(fname='fig.png')[source]

Saves the outpu of the Graphics object to the file fname.