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)Any given cubic polynomial:
y=a0+a1x+a2x2+a3x3 , where the indexed a's are real constants,
in the interval of x : x0 ≤ x ≤ x0+χ with χ>0 ,
can be expressed by a single Bezier cubic curve. The relation between the variable x and the parameter of the Bezier curve t is t=(x−x0)/χ .
The cubic Bezier curve is defined by four points Pn(Pnx , Pny) with n=0,1,2,3 ,
where P0x=x0 , P1x=x1=x0+(χ/3) , P2x=x2=x0+(2χ/3) and P3x=x3=x0+χ .
By denoting yn=y(xn) for n=0,1,2,3 , one obtains
P0y=y0 and P3y=y3 and for the control points :
P1y=( -5y0 +18y1 -9y2 +2y3 ) / 6 and
P2y=( 2y0 -9y1 +18y2 -5y3 ) / 6 .
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