Monday, September 27, 2010

Math equation input 2


`sum_(i=1)^n i^3=((n(n+1))/2)^2`



\begin{gra ph}width=400; height=300; xmin=-6.3; xmax=6.3;
xscl=1; plot(3cos(x^2)) \end{graph}

amath
Displacement: s = u t + 1/2 a t^2
Trigonometry: tan^2x+1=sec^2x
Summation: pi = 4 sum_(i=1)^(n) ((-1)^(k+1))/(2k-1)
endamath


`$f(x)=\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$`

`f(x)=sum_{n=0}^oo (f^n (a))/(n!) (x-a)^n`

Matrices

AB=(8451)(-851-15)=(8×-8+4×18×5+4×-155×-8+1×15×5+1×-15)

=(-60-20-3910)
Quadratic Equation

If ax2+bx+c=0, then

x=-b±b2-4ac2a
Fractions on Fractions

6x+232x+4=6x+2 ÷ 32x+4=6x+2×2(x+2)3=4
Roots

x3≠3x
Another matrix example

This next example was one I tried to create using WPMathPub but had trouble because it wasn’t very intuitive (see WPMathPub article).

[53cos26701-2sin5]

Now, that was much easier compared to WPMathPub! This is the code I used for the above ASCIIMathML:

[(5, 3, cos 2), (6, 7, 0), (1,-2, sin 5)]

In ASCIIMathML, it can be rendered easily like this:

3∫x2 dx+5∫x dx+9∫ dx


This is some example code:

\begin{gra ph}width=400; height=300; xmin=-6.3; xmax=6.3;
xscl=1; plot(3cos(x^2)) \end{graph}

Here is the resulting graph. Move your mouse cursor over the graph – it tells you the x- and y-coordinates of the cursor position.

1 2 3 4 5 6 -1 -2 -3 -4 -5 -6 1 2 3 4 -1 -2 -3 -4
Update
width=400; height=300; xmin=-6.3; xmax=6.3;xscl=1; axes(); plot(3cos(x^2))

I’ll do a separate article soon about the graphing capabilities of ASCIIMathML.




agraph plot(sin(x)) endagraph

setBorder(0)
initPicture(-5,5)
axes(2, 1, "labels", 1)

stroke = "blue"
plot("sin(x)")

stroke = "red"
plot(["5*t*cos(pi*t)", "5*t*sin(pi*t)"],0,1)

stroke = "green"
strokewidth = "2"
marker = "arrowdot"
line([0,1], [pi/2,1])
dot([pi,0], "open", cpi)

text([-2.5,-2.5], "ASCIIsvg Example")



Type this See that Comment
`x^2+y_1+z_12^34` x2+y1+z1234 subscripts as in TeX, but numbers are treated as a unit
`sin^-1(x)` sin-1(x) function names are treated as constants
`d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h` ddxf(x)=limh→0f(x+h)-f(x)h complex subscripts are bracketed, displayed under lim
$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ ddxf(x)=limh→0f(x+h)-f(x)h standard LaTeX notation is an alternative
`f(x)=sum_(n=0)^oo(f^((n))(a))/(n!)(x-a)^n` f(x)=∑n=0∞f(n)(a)n!(x-a)n f^((n))(a) must be bracketed, else the numerator is only a
$f(x)=\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$ f(x)=∑n=0∞f(n)(a)n!(x-a)n standard LaTeX produces the same result
`int_0^1f(x)dx` ∫01f(x)dx subscripts must come before superscripts
`[[a,b],[c,d]]((n),(k))` [abcd](nk) matrices and column vectors are simple to type
`x/x={(1,if x!=0),(text{undefined},if x=0):}` xx={1ifx≠0undefinedifx=0 piecewise defined function are based on matrix notation
`a//b` a/b use // for inline fractions
`(a/b)/(c/d)` abcd with brackets, multiple fraction work as expected
`a/b/c/d` ab/cd without brackets the parser chooses this particular expression
`((a*b))/c` (a⋅b)c only one level of brackets is removed; * gives standard product
`sqrt sqrt root3x` x3 spaces are optional, only serve to split strings that should not match
`<< a,b >> and {:(x,y),(u,v):}` 〈a,b〉andxyuv angle brackets and invisible brackets
`(a,b]={x in RR | a < x <= b}` (a,b]={x∈ℝ|a grouping brackets don't have to match
`abc-123.45^-1.1` abc-123.45-1.1 non-tokens are split into single characters,
but decimal numbers are parsed with possible sign
`hat(ab) bar(xy) ulA vec v dotx ddot y` ab^xy¯A̲v→x.y.. accents can be used on any expression (work well in IE)
`bb{AB3}.bbb(AB].cc(AB).fr{AB}.tt[AB].sf(AB)` AB3..ℬ..AB.AB font commands; can use any brackets around argument
`stackrel"def"= or \stackrel{\Delta}{=}" "("or ":=)` =defor=Δ(or:=) symbols can be stacked
`{::}_(\ 92)^238U`  92238U prescripts simulated by subsuperscripts

No comments: