Eder.US

Simple Equation

Introduction

One of the biggest obstacles to using mathematical expressions on the web is that the user currently needs to worry about layout. Web users should not have to learn a layout engine.

The class is built as a recursive parser. It is pretty easy to add operations to the parser, but it will not scale to a huge set of operations. That is OK, we want to keep things simple. At some point a layout engine may be required for a complexity level. This is not a layout engine.

Currently, only graphical output is generated, but it is hoped that MathML output can be generated automatically if the browser supports it instead of the graphic.

Thanks

Thanks goes to all of the people that have submitted bugs and feature requests. Thanks also to Randy Morrow for updating integral and derivative support and fixing a size bug.

Demo:

Source:

Source is available.

Here is a zip file.

Requirements

Simple Equation requires PHP 4.2.0 or greater. Extension include: GD 2, libpng and FreeType (2.1.4 or greater). Transparency will not work on all browsers.

The standard Windows fonts symbol.ttf, timesi.ttf and times.ttf are or equivalents required to render. These fonts can be changed in the render function. Changing the fonts may require a change in the map also in that function. Note: It is probably illegal to simply copy these from Windows to use on Linux.

Design Science MathType Fonts provide eucsym.ttf to replace symbol.ttf, euclid.ttf to replace times.ttf, and euclidi.ttf to replace timesi.ttf. Symlinks are recommended to map these font files to the standard names. You should probably read the MathType Fonts License.

Functions:

f(x)function of x
f'(x)derivative of x
f"(x)second derivative of x
sqrt xSquare root of x
root y xyth root of x
int _ _ xintegral of x
int 1 3 xintegral from 1 to 3 of x
sum _ _ xsummation of x
sum 1 n xsummation from 1 to n of x
x ^ yx raised to the yth power
x * yx times y
bar xx bar
hat xx hat
x . yx times y
x / yx divided by y
x + yx plus y
x - yx minus y
x_yx sub y
forall xfor all x
exists xthere exists an x
backepsilonback epsilon
thereforetherefore
x ortho yx is orthogonal to y
x le yx is less than or equal to y
x <= yx is less than or equal to y
x =< yx is less than or equal to y
infinfinity
infinityinfinity
leftrightleft right arrow
leftleft arrow
upup arrow
rightright arrow
downdown arrow
pmplus or minus
+-plus or minus
x ge yx is greater than or equal to y
x >= yx is greater than or equal to y
x => yx is greater than or equal to y
x times yx times y
x cross yx cross y
x prop yx is proportional to y
partial / {partial x}derivative with respect to x
x dot yx dot y
x divide yx divided by y
x div yx divided by y
x ne yx not equal to y
x <> yx not equal to y
x congr yx is congruent to y
x approx yx is approximately y
alephAleph
imimaginary number
realreal number
wpp function (wp), Weierstrass p
x otimes yx otimes y
x oplus yx oplus y
nullnull or empty set
emptynull or empty set
x intersect yx intersection y
x union yx union y
x supset yx is a superset of y
x supseteq yx is a proper superset of y
x notsubset yx is not a subset of y
x propsubset yx is a proper subset of y
x subset yx is a subset of y
x element yx is an element of y
x in yx is in y
x notelement yx is not an element of y
x notin yx is not in y
angle xthe angle x
nablanabla
not xnot x
x and yx and y
x or yx or y
x equiv yx is logically equivalent to y
doubleleftrightdouble left right arrow
doubleleftdouble left arrow
doubleupdouble up arrow
doublerightdouble right arrow
x implies yx implies y
doubledowndouble down arrow
(x over y)x choose y

Parenthesis:

visible ()
invisible {}

Greek letters:

alpha is lowercase, Alpha is uppercase.

If you want to send actual e-mail, think about this: My name is david and my domain is eder.us.


Send me some bitcoins: 1PAc2UFS77zhsfdLz86rHynREXTKjWrRzY