cosh = function(x) {
    return (Math.exp(x) + Math.exp(-x)) * 0.5;
  }
This class allows the manipulation of complex numbers.
You can pass a complex number in different formats. Either as object, double, string or two integer parameters.

Object form
{ re: <real>, im: <imaginary> }
{ arg: <angle>, abs: <radius> }
{ phi: <angle>, r: <radius> }

Array / Vector form
[ real, imaginary ]

Double form
99.3 - Single double value

String form
'23.1337' - Simple real number
'15+3i' - a simple complex number
'3-i' - a simple complex number

Example:

var c = new Complex('99.3+8i');
c.mul({r: 3, i: 9}).div(4.9).sub(3, 2);