JSXGraph logo
JSXGraph
JSXGraph share

Share

Conic section: hyperbola
QR code
<iframe 
    src="https://www.jsxgraph.org/share/iframe/conic-section-hyperbola" 
    style="border: 1px solid black; overflow: hidden; width: 550px; aspect-ratio: 55 / 65;" 
    name="JSXGraph example: Conic section: hyperbola" 
    allowfullscreen
></iframe>
This code has to
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
   <div id="board-0" class="jxgbox" style="aspect-ratio: 1 / 1; width: 100%;" data-ar="1 / 1"></div>
</div>
<div id="board-1-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
   <div id="board-1" class="jxgbox" style="aspect-ratio: 1 / 1; width: 100%;" data-ar="1 / 1"></div>
</div>

<script type = "text/javascript"> 
    /*
    This example is licensed under a 
    Creative Commons Attribution 4.0 International License.
    https://creativecommons.org/licenses/by/4.0/
    
    Please note you have to mention 
    The Center of Mobile Learning with Digital Technology
    in the credits.
    */
    
    const BOARDID0 = 'board-0';
    const BOARDID1 = 'board-1';
    const BOARDID = BOARDID0;

    (function() {
    const board1=JXG.JSXGraph.initBoard(BOARDID0,{boundingbox:[-3,3,3,-3], keepaspectratio:true});
    
    var A = board1.create('point',[0,1]);
    var B = board1.create('point',[1,1]);
    var C = board1.create('point',[0,-1]);
    var hyp = board1.create('hyperbola',[A,B,C]);
    })();
    
    (function() {
    const board2=JXG.JSXGraph.initBoard(BOARDID1,{boundingbox:[-3,3,3,-3], keepaspectratio:true});
    
    var A = board2.create('point',[-1,0]);
    var B = board2.create('point',[1,0]);
    var s = board2.create('slider',[[-1,-2],[1,-2],[0,0.5,3]]);
    var hyp = board2.create('hyperbola',[A,B,function(){return s.Value();}]);
    })();
    
 </script> 
/*
This example is licensed under a 
Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/

Please note you have to mention 
The Center of Mobile Learning with Digital Technology
in the credits.
*/

const BOARDID0 = 'your_div_id_0'; // Insert your 1st board id here!
const BOARDID1 = 'your_div_id_1'; // Insert your 2nd board id here!

(function() {
const board1=JXG.JSXGraph.initBoard(BOARDID0,{boundingbox:[-3,3,3,-3], keepaspectratio:true});

var A = board1.create('point',[0,1]);
var B = board1.create('point',[1,1]);
var C = board1.create('point',[0,-1]);
var hyp = board1.create('hyperbola',[A,B,C]);
})();

(function() {
const board2=JXG.JSXGraph.initBoard(BOARDID1,{boundingbox:[-3,3,3,-3], keepaspectratio:true});

var A = board2.create('point',[-1,0]);
var B = board2.create('point',[1,0]);
var s = board2.create('slider',[[-1,-2],[1,-2],[0,0.5,3]]);
var hyp = board2.create('hyperbola',[A,B,function(){return s.Value();}]);
})();
<jsxgraph width="100%, 100%" aspect-ratio="1 / 1, 1 / 1" numberOfBoards="2" title="Conic section: hyperbola" description="This construction was copied from JSXGraph examples database: BTW HERE SHOULD BE A GENERATED LINKuseGlobalJS="false">
   /*
   This example is licensed under a 
   Creative Commons Attribution 4.0 International License.
   https://creativecommons.org/licenses/by/4.0/
   
   Please note you have to mention 
   The Center of Mobile Learning with Digital Technology
   in the credits.
   */
   
   (function() {
   const board1=JXG.JSXGraph.initBoard(BOARDID0,{boundingbox:[-3,3,3,-3], keepaspectratio:true});
   
   var A = board1.create('point',[0,1]);
   var B = board1.create('point',[1,1]);
   var C = board1.create('point',[0,-1]);
   var hyp = board1.create('hyperbola',[A,B,C]);
   })();
   
   (function() {
   const board2=JXG.JSXGraph.initBoard(BOARDID1,{boundingbox:[-3,3,3,-3], keepaspectratio:true});
   
   var A = board2.create('point',[-1,0]);
   var B = board2.create('point',[1,0]);
   var s = board2.create('slider',[[-1,-2],[1,-2],[0,0.5,3]]);
   var hyp = board2.create('hyperbola',[A,B,function(){return s.Value();}]);
   })();
   
</jsxgraph>

Conic section: 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 (may be a function, too).
// Define the ids of your boards in BOARDID0, BOARDID1,...

(function() {
const board1=JXG.JSXGraph.initBoard(BOARDID0,{boundingbox:[-3,3,3,-3], keepaspectratio:true});

var A = board1.create('point',[0,1]);
var B = board1.create('point',[1,1]);
var C = board1.create('point',[0,-1]);
var hyp = board1.create('hyperbola',[A,B,C]);
})();

(function() {
const board2=JXG.JSXGraph.initBoard(BOARDID1,{boundingbox:[-3,3,3,-3], keepaspectratio:true});

var A = board2.create('point',[-1,0]);
var B = board2.create('point',[1,0]);
var s = board2.create('slider',[[-1,-2],[1,-2],[0,0.5,3]]);
var hyp = board2.create('hyperbola',[A,B,function(){return s.Value();}]);
})();

license

This example is licensed under a Creative Commons Attribution 4.0 International License.
Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits.