Class Index | File Index

Classes


Class Complex


Defined in: complex2.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Complex(real, imaginary)
The first step in defining a class is defining the constructor function of the class.
Method Summary
Method Attributes Method Name and Description
<static>  
Complex.add(a, b)
Add two complex numbers and return the result.
 
<static>  
Complex.multiply(a, b)
 
<static>  
Complex.subtract(a, b)
 
 
Class Detail
Complex(real, imaginary)
The first step in defining a class is defining the constructor function of the class. This constructor should initialize any instance properties of the object. These are the essential "state variables" that make each instance of the class different.
Parameters:
real
{Number} The real part
imaginary
{Number} The complex part
Method Detail
<static> {Complex} Complex.add(a, b)
Add two complex numbers and return the result.
Parameters:
a
{Complex} A complex number
b
{Complex} A second complex number
Returns:
{Complex} The sum of a and b

magnitude()

<static> Complex.multiply(a, b)
Parameters:
a
b

negative()

<static> Complex.subtract(a, b)
Parameters:
a
b

toString()

valueOf()

Documentation generated by JsDoc Toolkit 2.3.2 on Sat Apr 03 2010 02:24:16 GMT+0100 (BST)