Package org.apache.commons.math.complex
Class ComplexUtils
- java.lang.Object
 - 
- org.apache.commons.math.complex.ComplexUtils
 
 
- 
public class ComplexUtils extends java.lang.ObjectStatic implementations of commonComplexutilities functions. 
- 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Complexpolar2Complex(double r, double theta)Creates a complex number from the given polar representation. 
 - 
 
- 
- 
Method Detail
- 
polar2Complex
public static Complex polar2Complex(double r, double theta)
Creates a complex number from the given polar representation.The value returned is
r·ei·theta, computed asr·cos(theta) + r·sin(theta)iIf either
rorthetais NaN, orthetais infinite,Complex.NaNis returned.If
ris infinite andthetais finite, infinite or NaN values may be returned in parts of the result, following the rules for double arithmetic.Examples:
polar2Complex(INFINITY, π/4) = INFINITY + INFINITY i polar2Complex(INFINITY, 0) = INFINITY + NaN i polar2Complex(INFINITY, -π/4) = INFINITY - INFINITY i polar2Complex(INFINITY, 5π/4) = -INFINITY - INFINITY i- Parameters:
 r- the modulus of the complex number to createtheta- the argument of the complex number to create- Returns:
 r·ei·theta- Throws:
 java.lang.IllegalArgumentException- if r is negative- Since:
 - 1.1
 
 
 - 
 
 -