MCPcopy Create free account
hub / github.com/arguiot/TheoremJS / cos

Method cos

__test__/theorem.js:425–444  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

423 return result.length == 1 ? result[0] : result
424 }
425 cos(n) {
426 if (n.isComplex) {
427 const a = n.a.toNumber()
428 const b = n.b.toNumber()
429
430 const re = Math.cos(a) * Math.cosh(b)
431 const im = Math.sin(a) * Math.sinh(b)
432
433 return this.complex(re, -im)
434 }
435 if (typeof n != 'object' || BigNumber.isBigNumber(n)) {
436 n = BigNumber.isBigNumber(n) == true ? n.toNumber() : n
437 n = [n]
438 }
439 let result = []
440 for (var i = 0; i < n.length; i++) {
441 result.push(Math.cos(n[i]).toFixed(15))
442 }
443 return result.length == 1 ? result[0] : result
444 }
445 cosh(n) {
446 if (n.isComplex) {
447 const a = n.a.toNumber()

Callers 15

angle2VecMethod · 0.95
drawCircularPointsMethod · 0.95
findRoots.jsFile · 0.80
logHypotFunction · 0.80
pow.jsFile · 0.80
exp.jsFile · 0.80
sinh.jsFile · 0.80
cosh.jsFile · 0.80
sin.jsFile · 0.80
tanh.jsFile · 0.80
cos.jsFile · 0.80
angle2Vec.jsFile · 0.80

Calls 4

complexMethod · 0.95
coshMethod · 0.80
sinMethod · 0.80
sinhMethod · 0.80

Tested by

no test coverage detected