MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / cosh

Method cosh

src/org/opensourcephysics/numerics/Complex.java:670–686  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

668 }
669
670 public Complex cosh() {
671 double scalar;
672 double temp1Re, temp1Im;
673 double temp2Re, temp2Im;
674 // cosh(z) = ( exp(z) + exp(-z) ) / 2
675 // first exp
676 scalar = Math.exp(re);
677 temp1Re = scalar*Math.cos(im);
678 temp1Im = scalar*Math.sin(im);
679 // second exp
680 scalar = Math.exp(-re);
681 temp2Re = scalar*Math.cos(-im);
682 temp2Im = scalar*Math.sin(-im);
683 temp1Re += temp2Re;
684 temp1Im += temp2Im;
685 return new Complex(0.5*temp1Re, 0.5*temp1Im);
686 }
687
688 public Complex tanh() {
689 double scalar;

Callers 1

builtInFunctionMethod · 0.80

Calls 3

expMethod · 0.80
cosMethod · 0.45
sinMethod · 0.45

Tested by

no test coverage detected