Package

org.taffy.core.maths

Object Hierarchy
What is it?

A ComplexNumber object is a complex number. The ComplexNumber class is atomic.

Quick Example
a = 3 + 2i



Table of Contents:

Constructing a Complex Number

A Complex Number is simple to create. It is written:

a = 1 + 2i
b = 2.3 - 3i
c = 4.4444 - 55.111i

Arithmetic

Complex Numbers support the following mathematical operators:

Complex Number Operators
+ (add)
+= (add-equals)
- (subtract)
-= (subtract-equals)
/ (divide)
/= (divide-equals)
* (multiply)
*= (multiply-equals)
^ (raise)
^= (raise-equals)
% (modulus)
~= (delta-equals)

Querying

The real and imaginary components of a ComplexNumber are queryied by the real ang imaginary methods, respectively:

a = 1 + 2i

// query the real component of a
a real
==> 1

// query the imaginary component of a
a imaginary
==> 2