Piecewise declarations

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

Piecewise declarations are used in mathematics to describe a function that has a different definition in different intervals. In content markup, piecewise declarations are represented using the three constructor elements: piecewise, piece, and otherwise. The entire declaration is enclosed in a single piecewise element, and each piece of the declaration is enclosed in a separate piece element. Each piece element takes two child elements: the first one gives the value and the second argument gives the condition or interval in which that value is taken. That is, it has the form:

<piecewise>
  <piece> value condition </piece>
    ....
  <piece> value condition </piece>
  <otherwise> value </otherwise>
</piecewise>

Each occurrence of value and condition is itself indicated by other content elements. For example, the definition of the absolute function and its representation in content markup are shown below:

Piecewise declarations

<piecewise>
  <piece>
    <apply><minus/><ci>x</ci></apply>
    <apply><lt/><ci>x</ci><cn>0</cn></apply>
  </piece>
  <piece>
    <cn>0</cn>
    <apply><eq/><ci>x</ci><cn>0</cn></apply>
  </piece>
  <otherwise>
    <ci>x</ci>
  </otherwise>
</piecewise>

   

<< back next >>

 

 

 

Tipp der data2type-Redaktion:
Zum Thema MathML bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an:

 

Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.


CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America