vmm3d.core3D
Class ComplexVector3D
- java.lang.Object
-
- vmm3d.core3D.ComplexVector3D
-
public class ComplexVector3D extends java.lang.ObjectA 3D vector with components of type Complex named x, y, and z.
-
-
Field Summary
Fields Modifier and Type Field and Description static ComplexVector3DORIGINThe origin, (ZERO_C,ZERO_C,ZERO_C).static ComplexVector3DUNIT_XThe unit vector in the x direction, (ONE_C,ZERO_C,ZERO_C).static ComplexVector3DUNIT_YThe unit vector in the y direction, (ZERO_C,ONE_C,ZERO_C).static ComplexVector3DUNIT_ZThe uint vector in the z direction, (ZERO_C,ZERO_C,ONE_C).ComplexxThe first component of the vector.ComplexyThe second component of the vector.ComplexzThe third component of the vector.
-
Constructor Summary
Constructors Constructor and Description 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
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidassign(Complex a, Complex b, Complex c)voidassign(ComplexVector3D v)voidassignMinus(ComplexVector3D v)voidassignPlus(ComplexVector3D v)voidassignTimes(Complex d)This vector is scalar multiplied by d.voidassignTimes(double r)booleanequals(java.lang.Object obj)Returns true ifobjis a non-null object whose class in ComplexVector3D and such that the three corrdinates of the vectorobjare the same as the coordinates of this vector.Vector3Dim()The imaginary part of a ComplexVector.ComplexVector3Dminus(ComplexVector3D v)Returns the vector difference of this vector and v.voidnegate()Multiplies each component of this vector by -1.doublenorm()Returns the length of this vector, computed asMath.sqrt(x*x+y*y+z*z)voidnormalize()Divides each component of the vector by the norm of the vector, giving a vector that has length 1.ComplexVector3Dplus(ComplexVector3D v)Returns the vector sum of this vector and v.Vector3Dre()The real part of a ComplexVector.ComplexVector3Dtimes(Complex d)Returns the scalar product of this vector times d.ComplexVector3Dtimes(double r)
-
-
-
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(ComplexVector3D v)
-
equals
public boolean equals(java.lang.Object obj)
Returns true ifobjis a non-null object whose class in ComplexVector3D and such that the three corrdinates of the vectorobjare the same as the coordinates of this vector.- Overrides:
equalsin classjava.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 asMath.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)
-
-
DMelt 3.0 © DataMelt by jWork.ORG