I am attempting to create a usable function within LaTeX such that its inputs are transformed mathematically. However, I cannot find any documentation that can perform such mathematical function definition.
Here is an example of what I am seeking:
Having defined a function entitled \myMathFunction
which accepts only one parameter, the follow usage:
\myMathFunction{2}
should output 6 if the function is defined as follows: ({#1} * 5) - {#1}^2
Where {#1}
is the parameter, and in the case of my example, is equal to 2
.
Additionally, the function should be usable within a PSTricks plot. E.g.
\psplot[
algebraic,
linecolor = red,
linewidth = 1pt
]{0}{TwoPi}
{\myMathFunction{x}}
Best Answer
A calculated table and the plotted curve: