Interval arithmetic approach to y = sin(ex) using Functionplot
As mentioned on the Sement approach page, most graph plotters have trouble with the graph of f(x) = sin(ex). The curve gets more tightly bunched together as x increases and most plotters fail at producing a neat graph.
Interval arithmetic approach
The Interval arithmetic approach by mauriciopoppe cleverly considers data points to be within an interval, and allows for the vagaries of javascript 64-bit numbers in order to give us a smooth graph, with no gaps or inaccurate maxima o minima.
It does a good job, even when plotting at the sub-pixel level (that is, providing data points that are closer together than 1 px on the screen).
You can see a demo of the aproach below. it usses Functionplot, which is an SVG-based grapher built on top of the interval arithmetic approach.
Instructions
You can:
- Change the multiple of the whole expression, e.g. plot y = 2.5 sin(ex) using the "Amplitude" slider
- Change the multiple of the exponent of e, e.g. plot y = sin(e2.5x) using the "q" slider
- Change the stroke width of the curve using the third slider.
- Vary the visible domain using the "Restrict domain" slider, or zoom using the mousewheel and pan by dragging.
- Choose different functions to plot, e.g. y = sin(ex) or y = x2 sin(ex).
Amplitude
q (mult of x)
Stroke width
Restrict domain
Function
Limitations
This is a generic graph plotter which does a good job of plotting points that are very close to each other. However, like all generic graph plotters, it relies on processing a particular set of points. In this case, we're using 5,000 points, and the graph just stops at around x = 700.
The "segments" version will create a plot for all values of x, up to the point where the graph plotter can't zoom out any more. (In the JSXGraph case, its maximum domain is [-60,000, 60,000].)