Matrix multiplication II: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 8: Line 8:


   var v = b1.create('point',[2,2],{style:5,name:'v'});
   var v = b1.create('point',[2,2],{style:5,name:'v'});
  var w = b1.create('point',[-2,1],{style:5,name:'w'});
   var va = b1.create('arrow',[[0,0],v]);
   var va = b1.create('arrow',[[0,0],v]);
  var wa = b1.create('arrow',[[0,0],w]);


   var v2 = b1.create('point',[
   var v2 = b1.create('point',[
       function() {return a.Value()*v.X()+b.Value()*v.Y();},
       function() {return a.Value()*v.X()+b.Value()*v.Y();},
       function() {return c.Value()*v.X()+d.Value()*v.Y();}],{style:7,name:"v'"});
       function() {return c.Value()*v.X()+d.Value()*v.Y();}],{style:7,name:"v'"});
  var w2 = b1.create('point',[
      function() {return a.Value()*w.X()+b.Value()*w.Y();},
      function() {return c.Value()*w.X()+d.Value()*w.Y();}],{style:7,name:"w'"});
   var va2 = b1.create('arrow',[[0,0],v2],{color:'black'});
   var va2 = b1.create('arrow',[[0,0],v2],{color:'black'});
  var wa2 = b1.create('arrow',[[0,0],w2],{color:'black'});


   var t = b1.create('text',[-8,5,function(){ return 'Matrix=|'+b1.round(a.Value(),2)+' '+b1.round(b.Value(),2)+'|'+'<br>'+'|'+b1.round(c.Value(),2)+' '+b1.round(d.Value(),2)+'|';}]);
   var t = b1.create('text',[-8,5,function(){ return 'Matrix=<br>|'+b1.round(a.Value(),2)+' '+b1.round(b.Value(),2)+'|'+'<br>'+'|'+b1.round(c.Value(),2)+' '+b1.round(d.Value(),2)+'|';}]);
   b1.unsuspendUpdate();
   b1.unsuspendUpdate();
</jsxgraph>
</jsxgraph>


[[Category:Examples]]
[[Category:Examples]]

Revision as of 07:47, 25 March 2011