Back to functions

cos


cosine

This function will return some known values for multiples of pi, pi/2, pi/3, etc. For numeric values it returns the javascript value for pi. In all other cases it returns a symbolic function. Expects radians.

Usage: nerdamer("cos(x)")


Parameters

expression x Returns the appropriate value if possible otherwise it returns the function with the simplified expression

Returns

Expression

EXAMPLES:
var r = nerdamer('cos(pi)');
console.log(r.toString());
var t = nerdamer('cos(x)')
console.log(t.toString());
var u = nerdamer('cos(pi/4)')
console.log(u.toString());
var v = nerdamer('cos(pi/2)')
console.log(v.toString());
v = nerdamer.cos('pi');
console.log(v)
OUTPUT:
Back to functions