Search on this site

 Functions4U Reference. QtfEquation

QtfEquation converts a String with equations or formulas into a drawable object able to be painted or included into QTF.

The functions parse the String searching for expresions and convert them into its graphic format.

Some expressions parsed are:

Greek symbols

sqrt(content)

integral(content, from, to)

summation(content, from, to)

^ as exponent.

Expressions like =, +, -, *, /.

Parenthesis () and brackets [].

 Public Method List

QtfRichObject QtfEquation(const String &str)

It converts formulas in str into an object ready to be inserted into a QTF String.

Drawing DrawEquation(const String &str)

It converts formulas in str into a Drawing object.

For example, the result of this code:

String myqtf;

QtfRichObject a = QtfEquation("(2/3)");

QtfRichObject b = QtfEquation("integral(sqrt(cos(phi_ini^2)) + i^2 + 6, i = 1, 10)*dx = cos((27+x^2)^3.25)/(PI*R_0^2)");

QtfRichObject c = QtfEquation("delta_i = a+b*x+c*x^2+d*x^3");

QtfRichObject d = QtfEquation("sqrt(cos(phi_ini^2))");

QtfRichObject e = QtfEquation("summation(a+b*x+c*x^2+d*x^3, x = h, h+1)*dx = SI_h");

myqtf << "[R3 This are some formulas in QTF:&" << a << "&" << b << "&" << c << "&" << d << "&" << e;

equation.SetData(myqtf);

is this: