# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.number.complex

## Class ElementaryFunction

• java.lang.Object
• com.numericalmethod.suanshu.number.complex.ElementaryFunction

• public class ElementaryFunction
extends Object
This class contains some elementary functions for complex number, Complex. The references for the formulae can be found in the following.
See Also:
• ### Constructor Detail

• #### ElementaryFunction

public ElementaryFunction()
• ### Method Detail

• #### log

public static Complex log(Complex z)
Natural logarithm of a complex number.
ln(a + bi) = ln(r exp(i θ)) = ln(r) + i θ
Parameters:
z - a complex number
Returns:
ln(z)
Throws:
IllegalArgumentException - if z is a NaN or
• #### exp

public static Complex exp(Complex z)
Exponential of a complex number.

exp(a + bi) = exp(a) * [cos(b) + i sin(b)]
= exp(b)cos(b) + i exp(a)sin(b)

Parameters:
z - a complex number
Returns:
ez
Throws:
IllegalArgumentException - if z is a NaN or
• #### pow

public static Complex pow(Complex z1,
Complex z2)
z1 to the power z2.
(r exp(i θ)) ^ (a + bi) = r^a exp(-b θ) (cos(b ln(r) + a θ) + i sin(b ln(r) + a θ))
Parameters:
z1 - a complex number
z2 - a complex number
Returns:
z1z2
Throws:
IllegalArgumentException - if z is a NaN or
• #### sin

public static Complex sin(Complex z)
Sine of a complex number.
sin(a + bi) = sin(a)cosh(b) + i cos(a)sinh(b)
Parameters:
z - a complex number
Returns:
sin(z)
Throws:
IllegalArgumentException - if z is a NaN or
• #### cos

public static Complex cos(Complex z)
Cosine of a complex number.
cos(a + bi) = cos(a)cosh(b) - i sin(a)sinh(b)
Parameters:
z - a complex number
Returns:
cos(z)
Throws:
IllegalArgumentException - if z is a NaN or
• #### tan

public static Complex tan(Complex z)
Tangent of a complex number.

tan(a + bi) = [sin(2a) + i sinh(2a)] / [cos(2a) + cosh(2b)]

Parameters:
z - a complex number
Returns:
tan(z)
Throws:
IllegalArgumentException - if z is a NaN or
• #### sinh

public static Complex sinh(Complex z)
Hyperbolic sine of a complex number.
sinh(a + bi) = sinh(a)cos(b) + i cosh(a)sin(b)
Parameters:
z - a complex number
Returns:
sinh(z)
Throws:
IllegalArgumentException - if z is a NaN or
• #### cosh

public static Complex cosh(Complex z)
Hyperbolic cosine of a complex number.
cosh(a + bi) = cosh(a)cos(b) + i sinh(a)sin(b)
Parameters:
z - a complex number
Returns:
cosh(z)
Throws:
IllegalArgumentException - if z is a NaN or
• #### tanh

public static Complex tanh(Complex z)
Hyperbolic tangent of a complex number.
tanh(a + bi) = [sinh(2a) + i sin(2b)] / [cosh(2a) + cos(2b)]
Parameters:
z - a complex number
Returns:
tanh(z)
Throws:
IllegalArgumentException - if z is a NaN or

Copyright © 2010-2018 Numerical Method Incorporation Limited. All Rights Reserved.