Examples in the JSXGraph-wiki:
First impressions (the points A,B,C,D,E can be dragged):
Here is the source code for the above construction. It uses the JSXGraph plugin for WordPress.
<pre><jsxgraph width="500" height="500" box="box">
brd = JXG.JSXGraph.initBoard('box',
{axis:true,originX: 250, originY: 250, unitX: 50, unitY: 25});
brd.suspendUpdate();
var p = [];
p[0] = brd.create('point', [-4,2], {style:6});
p[1] = brd.create('point', [3,-1], {style:6});
addPoint(-2);
addPoint(0.5);
addPoint(1);
var pol = brd.lagrangePolynomial(p);
g = brd.create('functiongraph', [pol, -10, 10], {strokeWidth:3});
g2 = brd.create('functiongraph', [brd.D(pol), -10, 10],
{dash:3, strokeColor:'#ff0000'});
function addPoint(x) {
p.push(brd.create('point',
[x,(Math.random()-0.5)*3],{style:6}));
brd.update();
}
brd.unsuspendUpdate();
</jsxgraph></pre>
9 Comments
Cool.
I am a teacher. I would like to create a regular n-sided polygon inscribed inside a circle with radius r. Both r and n should be controlled by sliders. How can this be done?
Maybe, the example
http://jsxgraph.uni-bayreuth.de/wiki/index.php/Circle_approximation
from our wiki is helpful.
Thanks very much for your help. The stuffs are so great that I am very much addicted to it.
I have two more questions.
1. When I use brd.riemannsum(f,500,type,0,6).toFixed(4) and f = function(x) { return x*x;} with any type (left, right … etc), the result is 72.2160. The accuracy seems not very good. Any way to improve it?
2. Is there a way to have a slider without the value displayed on its side?
Thanks again for the cool stuff.
1) Is it possible that you called
type = left;
brd.riemannsum(f,500,type,0,6).toFixed(4)
instead of
type = ‘left’;
brd.riemannsum(f,500,type,0,6).toFixed(4) ?
i.e. type has to contain a string.
2) Good request! The next release will enable the attribute “withLabel:false” for sliders, too.
Thank you very much,
Alfred
Thanks!
I did use a string ‘left’ to test and still get the same answer 72.2160.
The page
http://jsxgraph.uni-bayreuth.de/wiki/index.php/Riemann_sum_III
contains your example and it works. Maybe, there is some simple typo in your code.
I found your (impressive) wiki page.
The problem is a small typo:
brd.createElement(‘text’,[-5.5,17,
function(){ return '`~~` ' +
(brd.riemannsum(f,n.Value(),ftype(),a,b.Value())).toFixed(4); }]);
i.e. ftype() instead of ftype.
Thanx a lot!
9 Trackbacks
[...] JSXGraph » Examples [...]
[...] Homepage (No Ratings Yet) Loading … ,1 views addthis_url = ‘http://www.codeindex.cn/9861′; addthis_title = ‘强大的JS画图工具 – JSXGraph’; addthis_pub = ‘grf110′; 相关阅读 (related posts): PHP、AJAX动态布局 — April 27, 2009用Jquery创建类型 Skype-like 的按钮 — April 25, 2009Javascript, Ajax, jQuery工具箱 — April 21, 2009(mb)Gallery 1.0 — April 17, 2009Switch Page Layouts with jQuery & CSS — April 11, 2009jQuery菜单 – jBreadCrumb — April 11, 2009一个轻量级的jQuery lightbox — April 7, 2009Sliding Boxes and Captions with jQuery — April 7, 2009Simple Toggle with CSS & jQuery — April 5, 2009Side Navigation Tooltip / Popup Bubble — April 5, 2009 Tagged with: [ jquery, JSXGraph, SVG, VML ] You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. [...]
[...] JSXGraph Demo [...]
[...] JSXGraph Demo [...]
[...] JSXGraph Demo [...]
[...] JSXGraph Demo [...]
[...] JSXGraph Demo [...]
[...] Link Live Examples Download [...]
[...] Link Live Examples Download [...]