java.lang.Object
javax.vecmath.Tuple4d
javax.vecmath.Vector4d
- All Implemented Interfaces:
Serializable
,Cloneable
A 4 element vector that is represented by double precision floating point
x,y,z,w coordinates.
- Version:
- specification 1.1, implementation $Revision: 1.9 $, $Date: 1999/10/05 07:03:50 $
- Author:
- Kenji hiranabe
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionVector4d()
Constructs and initializes a Vector4d to (0,0,0,0).Vector4d
(double[] v) Constructs and initializes a Vector4d from the specified array of length 4.Vector4d
(double x, double y, double z, double w) Constructs and initializes a Vector4d from the specified xyzw coordinates.Constructs and initializes a Vector4d from the specified Tuple3d.Constructs and initializes a Vector4d from the specified Tuple4d.Constructs and initializes a Vector4d from the specified Tuple4f.Constructs and initializes a Vector4d from the specified Vector4d.Constructs and initializes a Vector4d from the specified Vector4d. -
Method Summary
Modifier and TypeMethodDescriptionfinal double
Returns the (4-space) angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].clone()
final double
Computes the dot product of the this vector and vector v1.final double
length()
Returns the length of this vector.final double
Returns the squared length of this vector.final void
Normalizes this vector in place.final void
Sets the value of this vector to the normalization of vector v1.final void
Sets the x,y,z components of this point to the corresponding components of tuple t1.Methods inherited from class javax.vecmath.Tuple4d
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, get, hashCode, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString
-
Constructor Details
-
Vector4d
public Vector4d(double x, double y, double z, double w) Constructs and initializes a Vector4d from the specified xyzw coordinates.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinatew
- the w coordinate
-
Vector4d
public Vector4d(double[] v) Constructs and initializes a Vector4d from the specified array of length 4.- Parameters:
v
- the array of length 4 containing xyzw in order
-
Vector4d
Constructs and initializes a Vector4d from the specified Vector4d.- Parameters:
v1
- the Vector4d containing the initialization x y z w data
-
Vector4d
Constructs and initializes a Vector4d from the specified Vector4d.- Parameters:
v1
- the Vector4d containing the initialization x y z w data
-
Vector4d
Constructs and initializes a Vector4d from the specified Tuple4d.- Parameters:
t1
- the Tuple4d containing the initialization x y z w data
-
Vector4d
Constructs and initializes a Vector4d from the specified Tuple4f.- Parameters:
t1
- the Tuple4f containing the initialization x y z w data
-
Vector4d
public Vector4d()Constructs and initializes a Vector4d to (0,0,0,0). -
Vector4d
Constructs and initializes a Vector4d from the specified Tuple3d. The x,y,z components of this point are set to the corresponding components of tuple t1. The w component of this point is set to 0.- Parameters:
t1
- the tuple to be copied- Since:
- Java3D 1.2
-
-
Method Details
-
set
Sets the x,y,z components of this point to the corresponding components of tuple t1. The w component of this point is set to 1.- Parameters:
t1
- the tuple to be copied- Since:
- Java3D 1.2
-
lengthSquared
public final double lengthSquared()Returns the squared length of this vector.- Returns:
- the squared length of this vector
-
length
public final double length()Returns the length of this vector.- Returns:
- the length of this vector
-
dot
Computes the dot product of the this vector and vector v1.- Parameters:
v1
- the other vector- Returns:
- the dot product of this vector and vector v1
-
normalize
Sets the value of this vector to the normalization of vector v1.- Parameters:
v1
- the un-normalized vector
-
normalize
public final void normalize()Normalizes this vector in place. -
angle
Returns the (4-space) angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].- Parameters:
v1
- the other vector- Returns:
- the angle in radians in the range [0,PI]
-
clone
-