Difference between revisions of "Line"

From JSXGraph Wiki
Jump to navigationJump to search
(New page: == Construction of a line == A line needs two points. Lets construct two points "A" and "B". <source lang="javascript"> var b = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 100, unitX...)
 
Line 13: Line 13:
 
<div id="jxgbox" class="jxgbox" style="width:500px; height:200px;"></div>
 
<div id="jxgbox" class="jxgbox" style="width:500px; height:200px;"></div>
 
<script type="text/javascript">
 
<script type="text/javascript">
  var b = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 100, unitX: 50, unitY: 50});
+
  var brd = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 100, unitX: 50, unitY: 50});
  var p1 = board.createElement('point',[-1,1], {name:'A',style:6});
+
  var p1 = brd.createElement('point',[-1,1], {name:'A',style:6});
  var p2 = board.createElement('point',[2,-1], {name:'B',style:6});
+
  var p2 = brd.createElement('point',[2,-1], {name:'B',style:6});
 
</script>
 
</script>
 
</html>
 
</html>

Revision as of 17:35, 17 September 2008

Construction of a line

A line needs two points. Lets construct two points "A" and "B".

 var b = JXG.JSXGraph.initBoard('jxgbox', {originX: 200, originY: 100, unitX: 50, unitY: 50});
 var p1 = board.createElement('point',[-1,1], {name:'A',style:6});
 var p2 = board.createElement('point',[2,-1], {name:'B',style:6});