public static ComplexNumber Tan ( ComplexNumber z1 ) { ComplexNumber result = new ComplexNumber ( ) ; if ( z1 . imaginary == 0.0 ) { result . real = Math . tan ( z1 . real ) ; result . imaginary = 0.0 ; } else { double real2 = 2 * z1 . real ; double imag2 = 2 * z1 . imaginary ; double denom = Math . cos ( real2 ) + Math . cosh ( real2 ) ; result . real = Math . sin ( real2 ) / denom ; result . imaginary = Math . sinh ( imag2 ) / denom ; } return result ; }
Calculates Tangent value of the complex number .