3. Periodic functions



Note 3. Periodic function such as $f(x)=sin(x)$ has a period of $2π$, since the complete circle is $2π$ radians. The display ticks and grids in this case needs to be multiple of π. This is almost required for most trigonometric and periodic functions.
1. To display two complete periods of $sin(x)$, the bounding box is from $-π$ (-Math.PI) to $3π$ (3*Math.PI).
2. To display in multiple of $π$ and position the grid lines accordingly, use scale:Math.PI,scaleSymbol:’\\\\pi’. Note the use of double slashes so that MathJax can display the symbol $π$ (\pi) better than using standard HTML π. To skip the labeling every half $π$, set XG.Options.grid.gridX=Math.PI/2.0.
3. The sample points with coordinates are display at multiple of half $π$.
4. At smaller display scale, the point coordinates shown in the info box when the mouse is hovering over the points are inaccurate (display a very small number instead of 0), and should be disabled by setting showInfobox:false. This information is not meaningful when generating non-interactive graphs for pdf documents and must be disabled in this case.