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

Method sin

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

Source from the content-addressed store, hash-verified

489 return new BigNumber(x).times(180).div(this.pi)
490 }
491 sin(n) {
492 if (n.isComplex) {
493 const a = n.a.toNumber()
494 const b = n.b.toNumber()
495
496 const re = Math.cosh(b) * Math.sin(a)
497 const im = Math.cos(a) * Math.sinh(b)
498
499 return this.complex(re, im)
500 }
501 if (typeof n != 'object' || BigNumber.isBigNumber(n)) {
502 n = BigNumber.isBigNumber(n) == true ? n.toNumber() : n
503 n = [n]
504 }
505 let result = []
506 for (var i = 0; i < n.length; i++) {
507 result.push(Math.sin(n[i]).toFixed(15))
508 }
509 return result.length == 1 ? result[0] : result
510 }
511 sinh(n) {
512 if (n.isComplex) {
513 const a = n.a.toNumber()

Callers 15

angle2VecMethod · 0.95
drawCircularPointsMethod · 0.95
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
tan.jsFile · 0.80

Calls 4

complexMethod · 0.95
coshMethod · 0.80
cosMethod · 0.80
sinhMethod · 0.80

Tested by

no test coverage detected