vmm.core3D
Class ComplexVector3D

java.lang.Object
  extended by vmm.core3D.ComplexVector3D

public class ComplexVector3D
extends java.lang.Object

A 3D vector with components of type Complex named x, y, and z.


Field Summary
static ComplexVector3D ORIGIN
          The origin, (ZERO_C,ZERO_C,ZERO_C).
static ComplexVector3D UNIT_X
          The unit vector in the x direction, (ONE_C,ZERO_C,ZERO_C).
static ComplexVector3D UNIT_Y
          The unit vector in the y direction, (ZERO_C,ONE_C,ZERO_C).
static ComplexVector3D UNIT_Z
          The uint vector in the z direction, (ZERO_C,ZERO_C,ONE_C).
 Complex x
          The first component of the vector.
 Complex y
          The second component of the vector.
 Complex z
          The third component of the vector.
 
Constructor Summary
ComplexVector3D()
          Construct a vector with all three components initially equal to zero.
ComplexVector3D(Complex x, Complex y, Complex z)
          Construct a vector that initially has coordinates (x,y,z).
ComplexVector3D(ComplexVector3D v)
          Construct a vector that is initially a copy of a specified vector.
ComplexVector3D(Vector3D rea, Vector3D ima)
          Construct a vector that initially has real part rea and imaginary part ima.
 
Method Summary
 void assign(Complex a, Complex b, Complex c)
           
 void assign(ComplexVector3D v)
           
 void assignMinus(ComplexVector3D v)
           
 void assignPlus(ComplexVector3D v)
           
 void assignTimes(Complex d)
          This vector is scalar multiplied by d.
 void assignTimes(double r)
           
 boolean equals(java.lang.Object obj)
          Returns true if obj is a non-null object whose class in ComplexVector3D and such that the three corrdinates of the vector obj are the same as the coordinates of this vector.
 Vector3D im()
          The imaginary part of a ComplexVector.
 ComplexVector3D minus(ComplexVector3D v)
          Returns the vector difference of this vector and v.
 void negate()
          Multiplies each component of this vector by -1.
 double norm()
          Returns the length of this vector, computed as Math.sqrt(x*x+y*y+z*z)
 void normalize()
          Divides each component of the vector by the norm of the vector, giving a vector that has length 1.
 ComplexVector3D plus(ComplexVector3D v)
          Returns the vector sum of this vector and v.
 Vector3D re()
          The real part of a ComplexVector.
 ComplexVector3D times(Complex d)
          Returns the scalar product of this vector times d.
 ComplexVector3D times(double r)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public Complex x
The first component of the vector.


y

public Complex y
The second component of the vector.


z

public Complex z
The third component of the vector.


ORIGIN

public static final ComplexVector3D ORIGIN
The origin, (ZERO_C,ZERO_C,ZERO_C).


UNIT_X

public static final ComplexVector3D UNIT_X
The unit vector in the x direction, (ONE_C,ZERO_C,ZERO_C).


UNIT_Y

public static final ComplexVector3D UNIT_Y
The unit vector in the y direction, (ZERO_C,ONE_C,ZERO_C).


UNIT_Z

public static final ComplexVector3D UNIT_Z
The uint vector in the z direction, (ZERO_C,ZERO_C,ONE_C).

Constructor Detail

ComplexVector3D

public ComplexVector3D()
Construct a vector with all three components initially equal to zero.


ComplexVector3D

public ComplexVector3D(Complex x,
                       Complex y,
                       Complex z)
Construct a vector that initially has coordinates (x,y,z).


ComplexVector3D

public ComplexVector3D(Vector3D rea,
                       Vector3D ima)
Construct a vector that initially has real part rea and imaginary part ima.


ComplexVector3D

public ComplexVector3D(ComplexVector3D v)
Construct a vector that is initially a copy of a specified vector.

Parameters:
v - the constructed vector is (v.x, v.y, v.z), or is (0,0,0) if v is null.
Method Detail

assign

public void assign(Complex a,
                   Complex b,
                   Complex c)

assign

public void assign(ComplexVector3D v)

equals

public boolean equals(java.lang.Object obj)
Returns true if obj is a non-null object whose class in ComplexVector3D and such that the three corrdinates of the vector obj are the same as the coordinates of this vector.

Overrides:
equals in class java.lang.Object

re

public Vector3D re()
The real part of a ComplexVector.


im

public Vector3D im()
The imaginary part of a ComplexVector.


norm

public double norm()
Returns the length of this vector, computed as Math.sqrt(x*x+y*y+z*z)


normalize

public void normalize()
Divides each component of the vector by the norm of the vector, giving a vector that has length 1. However, if the vector is zero, or if any of its components are infinite or undefined, then the result of calling this method is to set all the components of the vector to Double.NaN. This method modifies the vector.


negate

public void negate()
Multiplies each component of this vector by -1. This method modifies the vector.


plus

public ComplexVector3D plus(ComplexVector3D v)
Returns the vector sum of this vector and v. A new vector object is constructed to contain the result; neither input vector is modified.

Parameters:
v - a non-null vector

assignPlus

public void assignPlus(ComplexVector3D v)

minus

public ComplexVector3D minus(ComplexVector3D v)
Returns the vector difference of this vector and v. A new vector object is constructed to contain the result; neither input vector is modified.

Parameters:
v - a non-null vector

assignMinus

public void assignMinus(ComplexVector3D v)

times

public ComplexVector3D times(Complex d)
Returns the scalar product of this vector times d. A new vector object is constructed to contain the result; the vector is not modified.

Parameters:
d - the scalar that is to be multiplied times this vector

times

public ComplexVector3D times(double r)

assignTimes

public void assignTimes(Complex d)
This vector is scalar multiplied by d. No new object is constructed.


assignTimes

public void assignTimes(double r)