Requirements for the expressions library and app
Before we embark on writing the library, let us scribble down a preliminary requirement statement, which is as follows:
The ability to plot the result of arbitrary mathematical expressions is a common requirement for business applications. We need to parse an expression to evaluate the resulting tree-structured representation. The process of lexical analysis, parsing, modeling expression nodes, recursive evaluation, and so on should be opaque to the application programmer. The library should support some trigonometric functions and a variable ($t
) to pass the information of the current X-coordinate of the graphics surface. The application should evaluate the value of the Y-coordinate for each value of the X-coordinate passed to the expression evaluation engine.