Dynamic Equation


1 comment

  • Support Admin

    To change an equation, alter the text of the equation each time the slider value is changed. There are two ways to implement a superscript character or number: using the XML tag <sup></sup>, or the Alt-Code for the superscript character. E.g.

     <p name="myEquation">y = ax² + bx + c</p>

    <p name="myOtherEquation">y = ax<sup>2</sup> + bx + c</p>

    <slider name="aSlider" min="0" max="4" value="1">
    myEquation.Text = string.format("y = %.2fx² + bx + c", value)

    myOtherEquation.FormattedText = string.format("y = %.2fx<sup>2</sup> + bx + c", value)

    Note that when using the XML <sup> tag, the code must be wrapped in CDATA, and FormattedText must be used. 


    Comment actions Permalink

Please sign in to leave a comment.