All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.Double3Vector

java.lang.Object
   |
   +----JSci.maths.MathVector
           |
           +----JSci.maths.DoubleVector
                   |
                   +----JSci.maths.Double3Vector

public class Double3Vector
extends DoubleVector
The Double3Vector class encapsulates double 3-vectors.


Constructor Index

 o Double3Vector()
Constructs an empty 3-vector.
 o Double3Vector(double, double, double)
Constructs a 3-vector.

Method Index

 o add(Double3Vector)
Returns the addition of this vector and another.
 o add(MathVector)
Returns the addition of this vector and another.
 o dimension()
Returns the vector's dimension.
 o equals(Object)
Compares two double vectors for equality.
 o getComponent(int)
Returns a component of this vector.
 o hashCode()
Returns a hashcode for this vector.
 o infNorm()
Returns the l(infinity)-norm.
 o mapComponents(Mapping)
Applies a function on all the vector components.
 o multiply(Double3Vector)
Returns the vector product of this vector and another (so(3) algebra).
 o norm()
Returns the l2-norm (magnitude).
 o norm(int)
Returns the ln-norm.
 o scalarDivide(double)
Returns the division of this vector by a scalar.
 o scalarMultiply(double)
Returns the multiplication of this vector by a scalar.
 o scalarProduct(Double3Vector)
Returns the scalar product of this vector and another.
 o setComponent(int, double)
Sets the value of a component of this vector.
 o subtract(Double3Vector)
Returns the subtraction of this vector by another.
 o subtract(MathVector)
Returns the subtraction of this vector by another.
 o toComplexVector()
Converts this 3-vector to a complex 3-vector.
 o toIntegerVector()
Converts this 3-vector to an integer 3-vector.
 o toString()
Returns a comma delimited string representing the value of this vector.

Constructors

 o Double3Vector
 public Double3Vector()
Constructs an empty 3-vector.

 o Double3Vector
 public Double3Vector(double x,
                      double y,
                      double z)
Constructs a 3-vector.

Parameters:
x - x coordinate
y - y coordinate
z - z coordinate

Methods

 o equals
 public boolean equals(Object a)
Compares two double vectors for equality.

Parameters:
a - a double 3-vector
Overrides:
equals in class DoubleVector
 o toString
 public String toString()
Returns a comma delimited string representing the value of this vector.

Overrides:
toString in class DoubleVector
 o hashCode
 public int hashCode()
Returns a hashcode for this vector.

Overrides:
hashCode in class DoubleVector
 o toIntegerVector
 public IntegerVector toIntegerVector()
Converts this 3-vector to an integer 3-vector.

Returns:
an integer 3-vector
Overrides:
toIntegerVector in class DoubleVector
 o toComplexVector
 public ComplexVector toComplexVector()
Converts this 3-vector to a complex 3-vector.

Returns:
a complex 3-vector
Overrides:
toComplexVector in class DoubleVector
 o getComponent
 public double getComponent(int n)
Returns a component of this vector.

Parameters:
n - index of the vector component
Throws: VectorDimensionException
If attempting to access an invalid component.
Overrides:
getComponent in class DoubleVector
 o setComponent
 public void setComponent(int n,
                          double x)
Sets the value of a component of this vector.

Parameters:
n - index of the vector component
x - a number
Throws: VectorDimensionException
If attempting to access an invalid component.
Overrides:
setComponent in class DoubleVector
 o dimension
 public int dimension()
Returns the vector's dimension.

Overrides:
dimension in class DoubleVector
 o norm
 public double norm(int n)
Returns the ln-norm.

Overrides:
norm in class DoubleVector
 o norm
 public double norm()
Returns the l2-norm (magnitude).

Overrides:
norm in class DoubleVector
 o infNorm
 public double infNorm()
Returns the l(infinity)-norm.

Overrides:
infNorm in class DoubleVector
 o add
 public MathVector add(MathVector v)
Returns the addition of this vector and another.

 o add
 public Double3Vector add(Double3Vector v)
Returns the addition of this vector and another.

Parameters:
v - a double 3-vector
 o subtract
 public MathVector subtract(MathVector v)
Returns the subtraction of this vector by another.

 o subtract
 public Double3Vector subtract(Double3Vector v)
Returns the subtraction of this vector by another.

Parameters:
v - a double 3-vector
 o scalarMultiply
 public DoubleVector scalarMultiply(double x)
Returns the multiplication of this vector by a scalar.

Parameters:
x - a double
Returns:
a double 3-vector
Overrides:
scalarMultiply in class DoubleVector
 o scalarDivide
 public DoubleVector scalarDivide(double x)
Returns the division of this vector by a scalar.

Parameters:
x - a double
Returns:
a double 3-vector
Throws: ArithmeticException
If divide by zero.
Overrides:
scalarDivide in class DoubleVector
 o scalarProduct
 public double scalarProduct(Double3Vector v)
Returns the scalar product of this vector and another.

Parameters:
v - a double 3-vector
 o multiply
 public Double3Vector multiply(Double3Vector v)
Returns the vector product of this vector and another (so(3) algebra).

Parameters:
v - a double 3-vector
 o mapComponents
 public DoubleVector mapComponents(Mapping f)
Applies a function on all the vector components.

Parameters:
f - a user-defined function
Returns:
a double 3-vector
Overrides:
mapComponents in class DoubleVector

All Packages  Class Hierarchy  This Package  Previous  Next  Index