Difference between revisions of "Arithmetics of complex numbers"

From JSXGraph Wiki
Jump to: navigation, search
Line 56: Line 56:
 
         var y = brd2.createElement('point', [0,2], {style:4,fillColor:'red',strokeColor:'red',name:'y',trace:true});
 
         var y = brd2.createElement('point', [0,2], {style:4,fillColor:'red',strokeColor:'red',name:'y',trace:true});
 
         var xy = brd2.createElement('point',  
 
         var xy = brd2.createElement('point',  
               ["X(x)*X(y)-Y(x)*Y(y)","X(x)*Y(y)+X(y)*Y(x)"], {style:7,fillColor:'green',strokeColor:'green',name:'x+y',trace:true});
+
               ["X(x)*X(y)-Y(x)*Y(y)","X(x)*Y(y)+X(y)*Y(x)"], {style:7,fillColor:'green',strokeColor:'green',name:'x*y',trace:true});
 
         var c = brd2.createElement('circle',[org2,1],{strokeWidth:1,dash:1});         
 
         var c = brd2.createElement('circle',[org2,1],{strokeWidth:1,dash:1});         
 
</script>
 
</script>
Line 71: Line 71:
 
         var y = brd2.createElement('point', [0,2], {style:5,fillColor:'red',strokeColor:'red',name:'y',trace:true});
 
         var y = brd2.createElement('point', [0,2], {style:5,fillColor:'red',strokeColor:'red',name:'y',trace:true});
 
         var xy = brd2.createElement('point',  
 
         var xy = brd2.createElement('point',  
               ["X(x)*X(y)-Y(x)*Y(y)","X(x)*Y(y)+X(y)*Y(x)"], {style:7,fillColor:'green',strokeColor:'green',name:'x+y',trace:true});
+
               ["X(x)*X(y)-Y(x)*Y(y)","X(x)*Y(y)+X(y)*Y(x)"], {style:7,fillColor:'green',strokeColor:'green',name:'x*y',trace:true});
 
         var c = brd2.createElement('circle',[org2,1],{strokeWidth:1,dash:1});         
 
         var c = brd2.createElement('circle',[org2,1],{strokeWidth:1,dash:1});         
 
</source>
 
</source>
  
 
[[Category:Examples]]
 
[[Category:Examples]]

Revision as of 00:47, 4 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

        brd2 = JXG.JSXGraph.initBoard('box2', {originX: 250, originY: 250, unitX: 40, unitY: 40});
        // Axes
        b1axisx = brd2.createElement('axis', [[0,0], [1,0]], {});
        b1axisy = brd2.createElement('axis', [[0,0], [0,1]], {});
        
        var org2 = brd2.createElement('point', [0,0], {style:10,visible:true,fixed:true,name:' '});
        var x = brd2.createElement('point', [1,0], {style:5,fillColor:'blue',name:'x',trace:true});
        var y = brd2.createElement('point', [0,2], {style:5,fillColor:'red',strokeColor:'red',name:'y',trace:true});
        var xy = brd2.createElement('point', 
              ["X(x)*X(y)-Y(x)*Y(y)","X(x)*Y(y)+X(y)*Y(x)"], {style:7,fillColor:'green',strokeColor:'green',name:'x*y',trace:true});
        var c = brd2.createElement('circle',[org2,1],{strokeWidth:1,dash:1});