Inverse Composition Rules: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 47: Line 47:
var change = function(func,obj) {
var change = function(func,obj) {
  var t = obj.value;  
  var t = obj.value;  
  if (t=='sin') { func = function(x) { return Math.sin(x); }
  if (t=='sin') { func = function(x) { return Math.sin(x); }  
  else if (t=='cos') { func = function(x) { return Math.cos(x); }
  } else if (t=='cos') { func = function(x) { return Math.cos(x); }
  else if (t=='tan') { func = function(x) { return Math.tan(x); }
  } else if (t=='tan') { func = function(x) { return Math.tan(x); }
  else if (t=='square') { func = function(x) { return x*x; }
  } else if (t=='square') { func = function(x) { return x*x; }
  else if (t=='sinh') { func = function(x) { return brd.sinh(x); }
  } else if (t=='sinh') { func = function(x) { return brd.sinh(x); }
  else if (t=='exp') { func = function(x) { return Math.exp(x); }
  } else if (t=='exp') { func = function(x) { return Math.exp(x); }


  else if (t=='asin') { func = function(x) { return Math.asin(x); }
  } else if (t=='asin') { func = function(x) { return Math.asin(x); }
  else if (t=='acos') { func = function(x) { return Math.acos(x); }
  } else if (t=='acos') { func = function(x) { return Math.acos(x); }
  else if (t=='atan') { func = function(x) { return Math.atan(x); }
  } else if (t=='atan') { func = function(x) { return Math.atan(x); }
  else if (t=='sqrt') { func = function(x) { return Math.sqrt(x); }
  } else if (t=='sqrt') { func = function(x) { return Math.sqrt(x); }
  else if (t=='asinh') { func = function(x) { return Math.log(x+Math.sqrt(1+x*x)); }
  } else if (t=='asinh') { func = function(x) { return Math.log(x+Math.sqrt(1+x*x)); }
  else if (t=='log') { func = function(x) { return Math.log(x); }
  } else if (t=='log') { func = function(x) { return Math.log(x); }
}


}
}

Revision as of 13:31, 19 June 2009

f(x) sin(x) cos(x) tan(x) x2 sinh(x) exp(x)
 
g(x) arcsin(x) arccos(x) arctan(x) √(x) arcsinh(x) log(x)
 

The underlying JavaScript code