Arithmetics of complex numbers: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
===Addition of complex numbers=== | |||
<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/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> | ||
<div id="box" class="jxgbox" style="width:600px; height: | <div id="box" class="jxgbox" style="width:600px; height:400px;"></div> | ||
<script language="JavaScript"> | <script language="JavaScript"> | ||
board = JXG.JSXGraph.initBoard('box', {originX: 250, originY: 250, unitX: 40, unitY: 40}); | board = JXG.JSXGraph.initBoard('box', {originX: 250, originY: 250, unitX: 40, unitY: 40}); | ||
Line 10: | Line 11: | ||
b1axisy = board.createElement('axis', [[0,0], [0,1]], {}); | b1axisy = board.createElement('axis', [[0,0], [0,1]], {}); | ||
var org = board.createElement('point', [0,0], {style:10,visible:true,fixed:true}); | var org = board.createElement('point', [0,0], {style:10,visible:true,fixed:true,name:' '}); | ||
var x = board.createElement('point', [2,2], {style:5,fillColor:'blue',name:'x'}); | var x = board.createElement('point', [2,2], {style:5,fillColor:'blue',name:'x'}); | ||
var y = board.createElement('point', [-1,-3], {style:5,fillColor:'blue',name:'y'}); | var y = board.createElement('point', [-1,-3], {style:5,fillColor:'blue',name:'y'}); | ||
Line 25: | Line 26: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
board = JXG.JSXGraph.initBoard('box', {originX: 250, originY: 250, unitX: 40, unitY: 40}); | |||
// Axes | |||
b1axisx = board.createElement('axis', [[0,0], [1,0]], {}); | |||
b1axisy = board.createElement('axis', [[0,0], [0,1]], {}); | |||
var org = board.createElement('point', [0,0], {style:10,visible:true,fixed:true,name:' '}); | |||
var x = board.createElement('point', [2,2], {style:5,fillColor:'blue',name:'x'}); | |||
var y = board.createElement('point', [-1,-3], {style:5,fillColor:'blue',name:'y'}); | |||
var xy = board.createElement('point', | |||
["X(x)+X(y)","Y(x)+Y(y)"], {style:7,fillColor:'blue',name:'x+y'}); | |||
var ax =board.createElement('line', [org,x], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue'}); | |||
var ay =board.createElement('line', [org,y], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue'}); | |||
var axy =board.createElement('line', [org,xy], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'red'}); | |||
var ax2 =board.createElement('line', [x,xy], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue',strokeWidth:1,dash:1}); | |||
var ay2 =board.createElement('line', [y,xy], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue',strokeWidth:1,dash:1}); | |||
</source> | </source> | ||
===Multiplication of complex numbers=== | |||
<html> | |||
<div id="box2" class="jxgbox" style="width:600px; height:400px;"></div> | |||
<script language="JavaScript"> | |||
board = JXG.JSXGraph.initBoard('box2', {originX: 250, originY: 250, unitX: 40, unitY: 40}); | |||
// Axes | |||
b1axisx = board.createElement('axis', [[0,0], [1,0]], {}); | |||
b1axisy = board.createElement('axis', [[0,0], [0,1]], {}); | |||
var org = board.createElement('point', [0,0], {style:10,visible:true,fixed:true,name:' '}); | |||
var x = board.createElement('point', [1,1], {style:5,fillColor:'blue',name:'x'}); | |||
var y = board.createElement('point', [0,1], {style:5,fillColor:'blue',name:'y'}); | |||
var xy = board.createElement('point', | |||
["X(x)*X(y)-Y(x)*Y(y)","X(x)*Y(y)+X(y)*Y(x)"], {style:7,fillColor:'blue',name:'x+y'}); | |||
</script> | |||
</html> | |||
<source lang="javascript"> | |||
</source> | |||
[[Category:Examples]] | [[Category:Examples]] |
Revision as of 22:35, 3 December 2008
Addition of complex numbers
board = JXG.JSXGraph.initBoard('box', {originX: 250, originY: 250, unitX: 40, unitY: 40});
// Axes
b1axisx = board.createElement('axis', [[0,0], [1,0]], {});
b1axisy = board.createElement('axis', [[0,0], [0,1]], {});
var org = board.createElement('point', [0,0], {style:10,visible:true,fixed:true,name:' '});
var x = board.createElement('point', [2,2], {style:5,fillColor:'blue',name:'x'});
var y = board.createElement('point', [-1,-3], {style:5,fillColor:'blue',name:'y'});
var xy = board.createElement('point',
["X(x)+X(y)","Y(x)+Y(y)"], {style:7,fillColor:'blue',name:'x+y'});
var ax =board.createElement('line', [org,x], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue'});
var ay =board.createElement('line', [org,y], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue'});
var axy =board.createElement('line', [org,xy], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'red'});
var ax2 =board.createElement('line', [x,xy], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue',strokeWidth:1,dash:1});
var ay2 =board.createElement('line', [y,xy], {straightFirst:false,straightLast:false,lastArrow:true,strokeColor:'blue',strokeWidth:1,dash:1});
Multiplication of complex numbers