Difference between revisions of "Cosine"

From JSXGraph Wiki
Jump to navigationJump to search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
   <jsxgraph box="box" width="500" height="500">  
+
The cosine is a projection of the complex number exp(−ix) (which is a point on the unit circle in the complex plane) to the real axis on the complex plane. In the following interactive figure, you can drag the point x on the real axis and observe the behaviour of the complex number exp(−ix) and the varying value of cosine(x).
 +
 
 +
{|
 +
|Cosine
 +
|Unit Circle on the Complex Plane
 +
|-
 +
|  <jsxgraph box="boxR" width="500" height="500">
 +
      var brd1 = JXG.JSXGraph.initBoard('boxR', {boundingbox: [-10, 1.5, 10, -1.5], axis:true});
 +
      var xr = brd1.create('line',[[-9,0],[9,0]],{visible:false});
 +
      var x = brd1.create('glider',[-9,0,xr],{visible:true, name:'x'});
 +
      var y = brd1.create('point',[x.X(),Math.cos(x.X())],{size:1,name:'',strokeColor:'green'});
 +
      var x1 = brd1.create('segment',[x,y],{visible:true, straightFirst:false,straightLast:false,strokeColor:'red'});
 +
      x.on('drag', function(){ transform(x);});
 +
      var f = brd1.create('functiongraph',
 +
          [function(x){
 +
    return Math.cos(x);
 +
          }]);
 +
      brd1.create('text',[
 +
        function(){return x.X()+0.3;},
 +
        function(){return y.Y()*0.5;},
 +
        'cos'],{});
 +
      function transform(x) {
 +
        p2.setPosition(JXG.COORDS_BY_USER,[Math.cos(x.X()),Math.sin(x.X())]);
 +
        y.setPosition(JXG.COORDS_BY_USER,[x.X(),Math.cos(x.X())]);
 +
        brd.update();
 +
      }
 +
 
 +
   </jsxgraph>
 +
<jsxgraph box="box" width="500" height="500">  
 
       var brd = JXG.JSXGraph.initBoard('box', {boundingbox: [-1.5, 1.5, 1.5, -1.5], axis:true});  
 
       var brd = JXG.JSXGraph.initBoard('box', {boundingbox: [-1.5, 1.5, 1.5, -1.5], axis:true});  
 +
      brd1.addChild(brd);
 
       var ax = brd.create('line',[[0,0],[1,0]],{visible:false});
 
       var ax = brd.create('line',[[0,0],[1,0]],{visible:false});
 
       var ay = brd.create('line',[[0,0],[0,1]],{visible:false});
 
       var ay = brd.create('line',[[0,0],[0,1]],{visible:false});
Line 23: Line 52:
  
 
   </jsxgraph>  
 
   </jsxgraph>  
 +
|}
  
  <jsxgraph box="boxR" width="500" height="500">
 
      var brd1 = JXG.JSXGraph.initBoard('boxR', {boundingbox: [-10, 1.5, 10, -1.5], axis:true});
 
      var xr = brd1.create('line',[[-9,0],[9,0]],{visible:false});
 
      var x = brd1.create('glider',[-9,0,xr],{visible:true, name:'x'});
 
      var y = brd1.create('point',[x.X(),Math.cos(x.X())],{size:1,name:'',strokeColor:'green'});
 
      var x1 = brd1.create('segment',[x,y],{visible:true, straightFirst:false,straightLast:false,strokeColor:'red'});
 
      x.on('drag', function(){ transform(x);});
 
      var f = brd1.create('functiongraph',
 
          [function(x){
 
    return Math.cos(x);
 
          }]);
 
      brd1.create('text',[
 
        function(){return x.X()+0.3;},
 
        function(){return y.Y()*0.5;},
 
        'cos'],{});
 
      function transform(x) {
 
        p2.setPosition(JXG.COORDS_BY_USER,[Math.cos(x.X()),Math.sin(x.X())]);
 
        y.setPosition(JXG.COORDS_BY_USER,[x.X(),Math.cos(x.X())]);
 
        brd.update();
 
      }
 
  
  </jsxgraph>
 
  
 
[[Category:Contributions]]
 
[[Category:Contributions]]
 +
[[Category:Examples]]
 +
 +
[http://www.bookofproofs.org/branches/cosine/ read more about cosine on Bookofproofs]

Latest revision as of 15:21, 6 March 2016

The cosine is a projection of the complex number exp(−ix) (which is a point on the unit circle in the complex plane) to the real axis on the complex plane. In the following interactive figure, you can drag the point x on the real axis and observe the behaviour of the complex number exp(−ix) and the varying value of cosine(x).

Cosine Unit Circle on the Complex Plane

read more about cosine on Bookofproofs