Last Update: 17 May 2012

Here is a Java™ program that facilitates the graphical presentation of mathematical functions by SVG (Scalable Vector Graphics, the standard of the Internet Consortium). It needs elementary knowledge of Java™ and SVG.

Details of the algorithm used by the program were presented with animated graphics in a talk given at the SVGOpen2003 conference. People interested in applying the algorithm on a different platform (than java) and are using Internet Explorer with the plugin "Adobe SVG Viewer" could find interest in the section "A curve expressed as a Bezier path" of this talk.

This catalog of functions expressed as Bezier quadratic paths was obtained by the program described at Plotting mathematical functions. In order to be able to use it, please read this explanatory file first.

Here are the links to the text files containing the Bezier paths of the functions:

cosh (cosine hyperbolic)cosh-1 (1/cosh)

exponent (y=e^x)

hyperbola (x^2-y^2=1)

oneOverX (y=1/x)

sine (y=sin(x))

sinh (sine hyperbolic)

tangent (y=tan(x))

tanh (tangent hyperbolic)

xOnMn2 (y=1/(x^2))

xto4 (y=x^4)

Any given cubic polynomial:

*y=a _{0}+a_{1}x+a_{2}x^{2}+a_{3}x^{3}* , where the indexed

in the interval of

can be expressed by a single Bezier cubic curve. The relation between the variable

The cubic Bezier curve is defined by four points *P _{n}(P_{nx} , P_{ny})* with

where

By denoting

For the proof of this rule see the link.

The talk introduces a teachware project of mathematics for science students of the first year. It contains SVG graphics and animations, which could be displayed by Internet Explorer with the plugin "Adobe SVG Viewer".

One can see the whole transcript of the talk and the actual slide show of the presentation.

The project of the teachware (see "Animated Mathematics" - above) became in March 2005 a self consistent courseware of math for first year university and college students, containing calculus of one variable, and was hosted on the web at: http://mathanimated.com/.

For further details see Math Animated.

In order to take advantage of the scalability of SVG, tools for observing enlarged details of the graphics are necessary. The ASV (Adobe SVG viewer) provides such tools, but they are still missing (January 2007) in the native support of the Firefox browser. On the other hand, Firefox supplies some software methods that are applicable for constructing the tools.

The file zoom-and-pan-controlsViewBox.svg of Jonathan Watt was used with Firefox as a starting point. Since the file did not satisfy in full the zooming and paning requirements, the file was modified by the aid of getScreenCTM() and the "onresize" event handler, not supported by ASV. In addition the "onzoom" and "onscroll" event handlers were omitted, and a couple of controls, for original view (canceling the zoom and pan) and for showing the centre of the zoom, were added. All the controls remain on focus, even if the viewport is resized.

Any one interested can copy, modify and use the proposed solution panZoom.svg. For obvious reasons it does not run with ASV, but was tested with Firefox.

Back to home