123456789101112131415161718192021 |
- def getFunction(LHStok, RHStok, eqnVars, graphVars, dim):
- """Returns function for plotting
- Arguments:
- LHStok {list} -- expression tokens
- RHStok {list} -- expression tokens
- eqnVars {list} -- variables in equation
- graphVars {list} -- variables for plotting
- dim {int} -- dimenion of plot
- Returns:
- (LHS - RHS) {numpy.array(2D)/function(3D)} -- equation converted to compatible data type for plotting
- """
- LHS = getFuncExpr(LHStok, eqnVars, graphVars)
- if len(eqnVars) == dim:
- RHS = getFuncExpr(RHStok, eqnVars, graphVars)
- elif len(eqnVars) == dim - 1:
- RHS = graphVars[-1]
- return LHS - RHS
|