Menu

Conditions in formulas with MathML

Help
2006-04-15
2013-04-09
  • Nobody/Anonymous

    Hello,

    I've got a list of hundrets of simple mathematical formulas like

    f(x,y) = x*y
    or
    f(x,y) = (x-12)*y^2

    What I need is a representation of these formulas in a way that allows to distribute these information easily, e.g. with XML/MathML. Above formulas are easy to describe with MathML, but how do I describe formulas with conditions, e.g.:

    if(x < 127) then f(x) = x*2
    else f(x) = x*3

    Background: In the past these formulas were made available as a programming code (with "if" conditions in it). Different software systems just called the program method code with input variables as arguments and got back the function value. But now we need to distribute these formulas in a way that's not bound to a specific programming language, e.g. XML.

    Any hints?

    Thanks in advance!
    Jan

     
    • Tom Chekam

      Tom Chekam - 2006-04-16

      Hi,

      This is a good question.

      Technically, you can use MathcCast to write "if" and "then" as text.

      MathML Presentation is designed specifically for mathematics formulas. I don’t know of any language that is designed for logic the way you describe it, though there might be one. You could also use XHTML and write down the words "if" and "then" as just words and use MathCast’s Mathcasting capability to insert math tags within the XHTML document. Take a look in the help on Mathcasting if you are interested.

      Hope this helps,
      Tom

       

Log in to post a comment.