Matrix multiplication: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 1: Line 1:
<html>
<html>
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
<link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" />
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/overlib.js"></script>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/prototype.js"></script>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/prototype.js"></script>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>
<script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script>

Revision as of 08:30, 17 December 2008


References

The underlying JavaScript code

  b1 = JXG.JSXGraph.initBoard('box1', {originX: 150, originY: 150, unitX: 20, unitY: 20});
  b1.suspendUpdate();
  b1.createElement('axis', [[0,0], [1,0]], {});
  b1.createElement('axis', [[0,0], [0,1]], {});
  a = b1.createElement('slider',[-5.0,-2,10,-5,5,1],{name:'a'});
  b = b1.createElement('slider',[-5.0,-3,10,-5,5,0],{name:'b'});
  c = b1.createElement('slider',[-5.0,-4,10,-5,5,0],{name:'c'});
  d = b1.createElement('slider',[-5.0,-5,10,-5,5,1],{name:'d'});

  v = b1.createElement('point',[2,2],{style:5,name:'v'});
  w = b1.createElement('point',[-2,1],{style:5,name:'w'});
  va = b1.createElement('line',['Ursprung',v],{straightFirst:false, straightLast:false, lastArrow:true});
  wa = b1.createElement('line',['Ursprung',w],{straightFirst:false, straightLast:false, lastArrow:true});
  b1.unsuspendUpdate();

  b2 = JXG.JSXGraph.initBoard('box2', {originX: 150, originY: 150, unitX: 20, unitY: 20});
  b2.suspendUpdate();
  b2.createElement('axis', [[0,0], [1,0]], {});
  b2.createElement('axis', [[0,0], [0,1]], {});

  v2 = b2.createElement('point',[
       function() {return a.X()*v.X()+b.X()*v.Y();},
       function() {return c.X()*v.X()+d.X()*v.Y();}],{style:7,name:"v'"});
  w2 = b2.createElement('point',[
       function() {return a.X()*w.X()+b.X()*w.Y();},
       function() {return c.X()*w.X()+d.X()*w.Y();}],{style:7,name:"w'"});
  va2 = b2.createElement('line',['Ursprung',v2],{straightFirst:false, straightLast:false, lastArrow:true});
  wa2 = b2.createElement('line',['Ursprung',w2],{straightFirst:false, straightLast:false, lastArrow:true});
  t = b2.createElement('text',[-6,-2,function(){ return '|'+b2.round(a.X(),2)+' '+b2.round(b.X(),2)+'|'+'<br>'+'|'+b2.round(c.X(),2)+' '+b2.round(d.X(),2)+'|';}]);
  b2.unsuspendUpdate();