ComplexNumeric.imaginaryPart - return the imaginary component of the ComplexNumeric object
|
Calling Sequence
|
|
Numeric imaginaryPart() throws MapleException
|
|
Description
|
|
•
|
The imaginaryPart function returns a Numeric object, which represents the imaginary part of the ComplexNumeric.
|
•
|
To access the real component of the ComplexNumeric, use the realPart method.
|
|
|
Examples
|
|
import com.maplesoft.openmaple.*;
|
import com.maplesoft.externalcall.MapleException;
|
class Example
|
{
|
public static void main( String notused[] ) throws MapleException
|
{
|
String mapleArgs[];
|
Engine engine;
|
ComplexNumeric n1;
|
Numeric im;
|
mapleArgs = new String[1];
|
mapleArgs[0] = "java";
|
engine = new Engine( mapleArgs, new EngineCallBacksDefault(),
|
null, null );
|
n1 = (ComplexNumeric)engine.evaluate( "10+20*I:" );
|
System.out.println( n1 );
|
im = n1.imaginaryPart();
|
System.out.println( im );
|
}
|
}
|
|
|
Executing this code produces the following output.
|
|
Download Help Document
Was this information helpful?