Difference between revisions of "Conic sections"
From JSXGraph Wiki
Jump to navigationJump to searchA WASSERMANN (talk | contribs) |
|||
(10 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | ===Ellipse=== | ||
+ | The input elements for an ellipse are either | ||
+ | * three points: the two foci and a point on the ellipse | ||
+ | * two point and a number: the two foci and the length of the major axis (maybe a function, too). | ||
<jsxgraph width="600" height="400" box="jxgbox1"> | <jsxgraph width="600" height="400" box="jxgbox1"> | ||
+ | (function(){ | ||
var brd1=JXG.JSXGraph.initBoard('jxgbox1',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | var brd1=JXG.JSXGraph.initBoard('jxgbox1',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
Line 6: | Line 11: | ||
var C = brd1.create('point',[0,-1]); | var C = brd1.create('point',[0,-1]); | ||
var ell = brd1.create('ellipse',[A,B,C]); | var ell = brd1.create('ellipse',[A,B,C]); | ||
+ | })(); | ||
</jsxgraph> | </jsxgraph> | ||
+ | <source lang="javascript"> | ||
+ | var brd1=JXG.JSXGraph.initBoard('jxgbox1',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
+ | |||
+ | var A = brd1.create('point',[-1,1]); | ||
+ | var B = brd1.create('point',[1,1]); | ||
+ | var C = brd1.create('point',[0,-1]); | ||
+ | var ell = brd1.create('ellipse',[A,B,C]); | ||
+ | </source> | ||
<jsxgraph width="600" height="400" box="jxgbox2"> | <jsxgraph width="600" height="400" box="jxgbox2"> | ||
+ | (function(){ | ||
var brd2=JXG.JSXGraph.initBoard('jxgbox2',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | var brd2=JXG.JSXGraph.initBoard('jxgbox2',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
var A = brd2.create('point',[-1,0]); | var A = brd2.create('point',[-1,0]); | ||
var B = brd2.create('point',[1,0]); | var B = brd2.create('point',[1,0]); | ||
− | var s = brd2.create('slider',[[-1,-2],[1,-2],[0, | + | var s = brd2.create('slider',[[-1,-2],[1,-2],[0,4,10]]); |
var ell = brd2.create('ellipse',[A,B,function(){return s.Value();}]); | var ell = brd2.create('ellipse',[A,B,function(){return s.Value();}]); | ||
+ | })(); | ||
</jsxgraph> | </jsxgraph> | ||
+ | <source lang="javascript"> | ||
+ | var brd2=JXG.JSXGraph.initBoard('jxgbox2',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
+ | var A = brd2.create('point',[-1,0]); | ||
+ | var B = brd2.create('point',[1,0]); | ||
+ | var s = brd2.create('slider',[[-1,-2],[1,-2],[0,4,10]]); | ||
+ | var ell = brd2.create('ellipse',[A,B,function(){return s.Value();}]); | ||
+ | </source> | ||
+ | |||
+ | ===Hyperbola=== | ||
+ | The input elements for a hyperbola are either | ||
+ | * three points: the two foci and a point on the hyperbola | ||
+ | * two point and a number: the two foci and the length of the major axis (maybe a function, too). | ||
<jsxgraph width="600" height="400" box="jxgbox3"> | <jsxgraph width="600" height="400" box="jxgbox3"> | ||
+ | (function(){ | ||
var brd3=JXG.JSXGraph.initBoard('jxgbox3',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | var brd3=JXG.JSXGraph.initBoard('jxgbox3',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
Line 24: | Line 53: | ||
var C = brd3.create('point',[0,-1]); | var C = brd3.create('point',[0,-1]); | ||
var hyp = brd3.create('hyperbola',[A,B,C]); | var hyp = brd3.create('hyperbola',[A,B,C]); | ||
+ | })(); | ||
</jsxgraph> | </jsxgraph> | ||
+ | <source lang="javascript"> | ||
+ | var brd3=JXG.JSXGraph.initBoard('jxgbox3',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
+ | |||
+ | var A = brd3.create('point',[0,1]); | ||
+ | var B = brd3.create('point',[1,1]); | ||
+ | var C = brd3.create('point',[0,-1]); | ||
+ | var hyp = brd3.create('hyperbola',[A,B,C]); | ||
+ | </source> | ||
<jsxgraph width="600" height="400" box="jxgbox4"> | <jsxgraph width="600" height="400" box="jxgbox4"> | ||
+ | (function(){ | ||
var brd4=JXG.JSXGraph.initBoard('jxgbox4',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | var brd4=JXG.JSXGraph.initBoard('jxgbox4',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
var A = brd4.create('point',[-1,0]); | var A = brd4.create('point',[-1,0]); | ||
var B = brd4.create('point',[1,0]); | var B = brd4.create('point',[1,0]); | ||
− | var s = brd4.create('slider',[[-1,-2],[1,-2],[0,0.5, | + | var s = brd4.create('slider',[[-1,-2],[1,-2],[0,0.5,3]]); |
var hyp = brd4.create('hyperbola',[A,B,function(){return s.Value();}]); | var hyp = brd4.create('hyperbola',[A,B,function(){return s.Value();}]); | ||
+ | })(); | ||
</jsxgraph> | </jsxgraph> | ||
+ | <source lang="javascript"> | ||
+ | var brd4=JXG.JSXGraph.initBoard('jxgbox4',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
+ | |||
+ | var A = brd4.create('point',[-1,0]); | ||
+ | var B = brd4.create('point',[1,0]); | ||
+ | var s = brd4.create('slider',[[-1,-2],[1,-2],[0,0.5,3]]); | ||
+ | var hyp = brd4.create('hyperbola',[A,B,function(){return s.Value();}]); | ||
+ | </source> | ||
+ | ===Parabola=== | ||
+ | The input elements for a parabola are | ||
+ | * a point and a line: focus and the directrix | ||
<jsxgraph width="600" height="400" box="jxgbox5"> | <jsxgraph width="600" height="400" box="jxgbox5"> | ||
+ | (function(){ | ||
+ | var brd5=JXG.JSXGraph.initBoard('jxgbox5',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
+ | |||
+ | var A = brd5.create('point',[-1,1]); | ||
+ | var B = brd5.create('point',[1,1]); | ||
+ | var line = brd5.create('line',[A,B]); | ||
+ | var C = brd5.create('point',[0,-1]); | ||
+ | var par = brd5.create('parabola',[C,line]); | ||
+ | })(); | ||
+ | </jsxgraph> | ||
+ | <source lang="javascript"> | ||
var brd5=JXG.JSXGraph.initBoard('jxgbox5',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | var brd5=JXG.JSXGraph.initBoard('jxgbox5',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
Line 42: | Line 104: | ||
var line = brd5.create('line',[A,B]); | var line = brd5.create('line',[A,B]); | ||
var C = brd5.create('point',[0,-1]); | var C = brd5.create('point',[0,-1]); | ||
− | var | + | var par = brd5.create('parabola',[C,line]); |
+ | </source> | ||
+ | |||
+ | ===Conic section through five points=== | ||
+ | <jsxgraph width="600" height="400" box="jxgbox6"> | ||
+ | (function(){ | ||
+ | var brd6=JXG.JSXGraph.initBoard('jxgbox6',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
+ | |||
+ | var A = brd6.create('point',[0.55,0]); | ||
+ | var B = brd6.create('point',[1,1]); | ||
+ | var C = brd6.create('point',[2,-1]); | ||
+ | var D = brd6.create('point',[2,2]); | ||
+ | var E = brd6.create('point',[0.3,-2]); | ||
+ | var con = brd6.create('conic',[A,B,C,D,E]); | ||
+ | })(); | ||
</jsxgraph> | </jsxgraph> | ||
+ | <source lang="javascript"> | ||
+ | var brd6=JXG.JSXGraph.initBoard('jxgbox6',{boundingbox:[-3,3,3,-3], keepaspectratio:true}); | ||
+ | |||
+ | var A = brd6.create('point',[0.55,0]); | ||
+ | var B = brd6.create('point',[1,1]); | ||
+ | var C = brd6.create('point',[2,-1]); | ||
+ | var D = brd6.create('point',[2,2]); | ||
+ | var E = brd6.create('point',[0.3,-2]); | ||
+ | var con = brd6.create('conic',[A,B,C,D,E]); | ||
+ | </source> | ||
+ | |||
+ | [[Category:Geometry]] | ||
+ | [[Category:Examples]] |
Latest revision as of 10:12, 13 March 2015
Ellipse
The input elements for an ellipse are either
- three points: the two foci and a point on the ellipse
- two point and a number: the two foci and the length of the major axis (maybe a function, too).
var brd1=JXG.JSXGraph.initBoard('jxgbox1',{boundingbox:[-3,3,3,-3], keepaspectratio:true});
var A = brd1.create('point',[-1,1]);
var B = brd1.create('point',[1,1]);
var C = brd1.create('point',[0,-1]);
var ell = brd1.create('ellipse',[A,B,C]);
var brd2=JXG.JSXGraph.initBoard('jxgbox2',{boundingbox:[-3,3,3,-3], keepaspectratio:true});
var A = brd2.create('point',[-1,0]);
var B = brd2.create('point',[1,0]);
var s = brd2.create('slider',[[-1,-2],[1,-2],[0,4,10]]);
var ell = brd2.create('ellipse',[A,B,function(){return s.Value();}]);
Hyperbola
The input elements for a hyperbola are either
- three points: the two foci and a point on the hyperbola
- two point and a number: the two foci and the length of the major axis (maybe a function, too).
var brd3=JXG.JSXGraph.initBoard('jxgbox3',{boundingbox:[-3,3,3,-3], keepaspectratio:true});
var A = brd3.create('point',[0,1]);
var B = brd3.create('point',[1,1]);
var C = brd3.create('point',[0,-1]);
var hyp = brd3.create('hyperbola',[A,B,C]);
var brd4=JXG.JSXGraph.initBoard('jxgbox4',{boundingbox:[-3,3,3,-3], keepaspectratio:true});
var A = brd4.create('point',[-1,0]);
var B = brd4.create('point',[1,0]);
var s = brd4.create('slider',[[-1,-2],[1,-2],[0,0.5,3]]);
var hyp = brd4.create('hyperbola',[A,B,function(){return s.Value();}]);
Parabola
The input elements for a parabola are
- a point and a line: focus and the directrix
var brd5=JXG.JSXGraph.initBoard('jxgbox5',{boundingbox:[-3,3,3,-3], keepaspectratio:true});
var A = brd5.create('point',[-1,1]);
var B = brd5.create('point',[1,1]);
var line = brd5.create('line',[A,B]);
var C = brd5.create('point',[0,-1]);
var par = brd5.create('parabola',[C,line]);
Conic section through five points
var brd6=JXG.JSXGraph.initBoard('jxgbox6',{boundingbox:[-3,3,3,-3], keepaspectratio:true});
var A = brd6.create('point',[0.55,0]);
var B = brd6.create('point',[1,1]);
var C = brd6.create('point',[2,-1]);
var D = brd6.create('point',[2,2]);
var E = brd6.create('point',[0.3,-2]);
var con = brd6.create('conic',[A,B,C,D,E]);