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.
-
Double3Vector()
- Constructs an empty 3-vector.
-
Double3Vector(double, double, double)
- Constructs a 3-vector.
-
add(Double3Vector)
- Returns the addition of this vector and another.
-
add(MathVector)
- Returns the addition of this vector and another.
-
dimension()
- Returns the vector's dimension.
-
equals(Object)
- Compares two double vectors for equality.
-
getComponent(int)
- Returns a component of this vector.
-
hashCode()
- Returns a hashcode for this vector.
-
infNorm()
- Returns the l(infinity)-norm.
-
mapComponents(Mapping)
- Applies a function on all the vector components.
-
multiply(Double3Vector)
- Returns the vector product of this vector and another (so(3) algebra).
-
norm()
- Returns the l2-norm (magnitude).
-
norm(int)
- Returns the ln-norm.
-
scalarDivide(double)
- Returns the division of this vector by a scalar.
-
scalarMultiply(double)
- Returns the multiplication of this vector by a scalar.
-
scalarProduct(Double3Vector)
- Returns the scalar product of this vector and another.
-
setComponent(int, double)
- Sets the value of a component of this vector.
-
subtract(Double3Vector)
- Returns the subtraction of this vector by another.
-
subtract(MathVector)
- Returns the subtraction of this vector by another.
-
toComplexVector()
- Converts this 3-vector to a complex 3-vector.
-
toIntegerVector()
- Converts this 3-vector to an integer 3-vector.
-
toString()
- Returns a comma delimited string representing the value of this vector.
Double3Vector
public Double3Vector()
- Constructs an empty 3-vector.
Double3Vector
public Double3Vector(double x,
double y,
double z)
- Constructs a 3-vector.
- Parameters:
- x - x coordinate
- y - y coordinate
- z - z coordinate
equals
public boolean equals(Object a)
- Compares two double vectors for equality.
- Parameters:
- a - a double 3-vector
- Overrides:
- equals in class DoubleVector
toString
public String toString()
- Returns a comma delimited string representing the value of this vector.
- Overrides:
- toString in class DoubleVector
hashCode
public int hashCode()
- Returns a hashcode for this vector.
- Overrides:
- hashCode in class DoubleVector
toIntegerVector
public IntegerVector toIntegerVector()
- Converts this 3-vector to an integer 3-vector.
- Returns:
- an integer 3-vector
- Overrides:
- toIntegerVector in class DoubleVector
toComplexVector
public ComplexVector toComplexVector()
- Converts this 3-vector to a complex 3-vector.
- Returns:
- a complex 3-vector
- Overrides:
- toComplexVector in class DoubleVector
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
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
dimension
public int dimension()
- Returns the vector's dimension.
- Overrides:
- dimension in class DoubleVector
norm
public double norm(int n)
- Returns the ln-norm.
- Overrides:
- norm in class DoubleVector
norm
public double norm()
- Returns the l2-norm (magnitude).
- Overrides:
- norm in class DoubleVector
infNorm
public double infNorm()
- Returns the l(infinity)-norm.
- Overrides:
- infNorm in class DoubleVector
add
public MathVector add(MathVector v)
- Returns the addition of this vector and another.
add
public Double3Vector add(Double3Vector v)
- Returns the addition of this vector and another.
- Parameters:
- v - a double 3-vector
subtract
public MathVector subtract(MathVector v)
- Returns the subtraction of this vector by another.
subtract
public Double3Vector subtract(Double3Vector v)
- Returns the subtraction of this vector by another.
- Parameters:
- v - a double 3-vector
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
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
scalarProduct
public double scalarProduct(Double3Vector v)
- Returns the scalar product of this vector and another.
- Parameters:
- v - a double 3-vector
multiply
public Double3Vector multiply(Double3Vector v)
- Returns the vector product of this vector and another (so(3) algebra).
- Parameters:
- v - a double 3-vector
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