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

Method sinh

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

Source from the content-addressed store, hash-verified

650 //------------------------------------------------------------------------
651 // Hyperbolic trigonometric functions
652 public Complex sinh() {
653 double scalar;
654 double temp1Re, temp1Im;
655 double temp2Re, temp2Im;
656 // sinh(z) = ( exp(z) - exp(-z) ) / 2
657 // first exp
658 scalar = Math.exp(re);
659 temp1Re = scalar*Math.cos(im);
660 temp1Im = scalar*Math.sin(im);
661 // second exp
662 scalar = Math.exp(-re);
663 temp2Re = scalar*Math.cos(-im);
664 temp2Im = scalar*Math.sin(-im);
665 temp1Re -= temp2Re;
666 temp1Im -= temp2Im;
667 return new Complex(0.5*temp1Re, 0.5*temp1Im);
668 }
669
670 public Complex cosh() {
671 double scalar;

Callers 1

builtInFunctionMethod · 0.80

Calls 3

expMethod · 0.80
cosMethod · 0.45
sinMethod · 0.45

Tested by

no test coverage detected