vmm3d.pseudospherical
Class ComplexVector2D
- java.lang.Object
-
- vmm3d.pseudospherical.ComplexVector2D
-
public class ComplexVector2D extends java.lang.ObjectA 2D vector with components of type Complex named x, y.
-
-
Field Summary
Fields Modifier and Type Field and Description ComplexxThe first component of the vector.ComplexyThe second component of the vector.
-
Constructor Summary
Constructors Constructor and Description ComplexVector2D()Construct a vector with all components initially equal to zero.ComplexVector2D(Complex x, Complex y)Construct a vector that initially has coordinates (x,y).ComplexVector2D(ComplexVector2D v)Construct a vector that is initially a copy of a specified vector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Complexdot(ComplexVector2D v)Returns the Hermitian inner-prodct of this vector and v.booleanequals(java.lang.Object obj)Returns trueobjis a non-null object whose class in Vector2D and such that both coordinates of the vectorobjare the same as the coordinates of this vector.ComplexVector2Dminus(ComplexVector2D v)Returns the vector difference of this vector and v.voidnegate()Multiplies each component of this vector by -1.doublenorm2()Returns the norm square of the vector.ComplexVector2Dplus(ComplexVector2D v)Returns the vector sum of this vector and v.ComplexVector2Dtimes(Complex d)Returns the scalar product of this vector times d.java.lang.StringtoString()Returns a string representation of this vector of the form "(x,y)" where x, y are the numerical components of the vector.
-
-
-
Field Detail
-
x
public Complex x
The first component of the vector.
-
y
public Complex y
The second component of the vector.
-
-
Constructor Detail
-
ComplexVector2D
public ComplexVector2D()
Construct a vector with all components initially equal to zero.
-
ComplexVector2D
public ComplexVector2D(Complex x, Complex y)
Construct a vector that initially has coordinates (x,y).
-
ComplexVector2D
public ComplexVector2D(ComplexVector2D v)
Construct a vector that is initially a copy of a specified vector.- Parameters:
v- the constructed vector is (v.x, v.y), or is (ZERO_C,ZERO_C) if v is null.
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
Returns trueobjis a non-null object whose class in Vector2D and such that both coordinates of the vectorobjare the same as the coordinates of this vector.- Overrides:
equalsin classjava.lang.Object
-
negate
public void negate()
Multiplies each component of this vector by -1. This method modifies the vector.
-
plus
public ComplexVector2D plus(ComplexVector2D 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
-
minus
public ComplexVector2D minus(ComplexVector2D 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
-
dot
public Complex dot(ComplexVector2D v)
Returns the Hermitian inner-prodct of this vector and v.
-
times
public ComplexVector2D 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
-
norm2
public double norm2()
Returns the norm square of the vector. The norm is calculated by sqrt(|x|^2+|y|^2)
-
toString
public java.lang.String toString()
Returns a string representation of this vector of the form "(x,y)" where x, y are the numerical components of the vector.- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG