Top Description Fields Constructors Methods
javax.vecmath

public Class Vector4d

extends Tuple4d
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.lang.Math

A 4-element vector represented by double-precision floating point x,y,z,w coordinates.

Field Summary

Modifier and TypeField and Description
pack-priv static final long
Inherited from javax.vecmath.Tuple4d:
wxyz

Constructor Summary

AccessConstructor and Description
public
Vector4d(double
the x coordinate
x
,
double
the y coordinate
y
,
double
the z coordinate
z
,
double
the w coordinate
w
)

Constructs and initializes a Vector4d from the specified xyzw coordinates.

public
Vector4d(double[]
the array of length 4 containing xyzw in order
v
)

Constructs and initializes a Vector4d from the coordinates contained in the array.

public
Vector4d(Vector4d
the Vector4d containing the initialization x y z w data
v1
)

Constructs and initializes a Vector4d from the specified Vector4d.

public
Vector4d(Vector4f
the Vector4f containing the initialization x y z w data
v1
)

Constructs and initializes a Vector4d from the specified Vector4f.

public
Vector4d(Tuple4f
the Tuple4f containing the initialization x y z w data
t1
)

Constructs and initializes a Vector4d from the specified Tuple4f.

public
Vector4d(Tuple4d
the Tuple4d containing the initialization x y z w data
t1
)

Constructs and initializes a Vector4d from the specified Tuple4d.

public
Vector4d(Tuple3d
the tuple to be copied
t1
)

Constructs and initializes a Vector4d from the specified Tuple3d.

public
Vector4d()

Constructs and initializes a Vector4d to (0,0,0,0).

Method Summary

Modifier and TypeMethod and Description
public final double

Returns:

the angle in radians in the range [0,PI]
angle
(Vector4d
the other vector
v1
)

Returns the (4-space) angle in radians between this vector and the vector parameter; the return value is constrained to the range [0,PI].

public final double

Returns:

the dot product of this vector and vector v1
dot
(Vector4d
the other vector
v1
)

Returns the dot product of this vector and vector v1.

public final double

Returns:

the length of this vector
length
()

Returns the length of this vector.

public final double

Returns:

the squared length of this vector
lengthSquared
()

Returns the squared length of this vector.

public final void
normalize(Vector4d
the un-normalized vector
v1
)

Sets the value of this vector to the normalization of vector v1.

public final void
normalize()

Normalizes this vector in place.

public final void
set(Tuple3d
the tuple to be copied
t1
)

Sets the x,y,z components of this vector to the corresponding components of tuple t1.

Inherited from javax.vecmath.Tuple4d:
absoluteabsoluteaddaddclampclampclampclampclampMaxclampMaxclampMaxclampMaxclampMinclampMinclampMinclampMincloneepsilonEqualsequalsequalsgetgetgetWgetXgetYgetZhashCodeinterpolateinterpolateinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddscaleAddsetsetsetsetsetWsetXsetYsetZsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple4d.serialVersionUID.

Constructor Detail

Vector4dback to summary
public Vector4d(double x, double y, double z, double w)

Constructs and initializes a Vector4d from the specified xyzw coordinates.

Parameters
x:double

the x coordinate

y:double

the y coordinate

z:double

the z coordinate

w:double

the w coordinate

Vector4dback to summary
public Vector4d(double[] v)

Constructs and initializes a Vector4d from the coordinates contained in the array.

Parameters
v:double[]

the array of length 4 containing xyzw in order

Vector4dback to summary
public Vector4d(Vector4d v1)

Constructs and initializes a Vector4d from the specified Vector4d.

Parameters
v1:Vector4d

the Vector4d containing the initialization x y z w data

Vector4dback to summary
public Vector4d(Vector4f v1)

Constructs and initializes a Vector4d from the specified Vector4f.

Parameters
v1:Vector4f

the Vector4f containing the initialization x y z w data

Vector4dback to summary
public Vector4d(Tuple4f t1)

Constructs and initializes a Vector4d from the specified Tuple4f.

Parameters
t1:Tuple4f

the Tuple4f containing the initialization x y z w data

Vector4dback to summary
public Vector4d(Tuple4d t1)

Constructs and initializes a Vector4d from the specified Tuple4d.

Parameters
t1:Tuple4d

the Tuple4d containing the initialization x y z w data

Vector4dback to summary
public Vector4d(Tuple3d t1)

Constructs and initializes a Vector4d from the specified Tuple3d. The x,y,z components of this vector are set to the corresponding components of tuple t1. The w component of this vector is set to 0.

Parameters
t1:Tuple3d

the tuple to be copied

Since
vecmath 1.2
Vector4dback to summary
public Vector4d()

Constructs and initializes a Vector4d to (0,0,0,0).

Method Detail

angleback to summary
public final double angle(Vector4d v1)

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:Vector4d

the other vector

Returns:double

the angle in radians in the range [0,PI]

dotback to summary
public final double dot(Vector4d v1)

Returns the dot product of this vector and vector v1.

Parameters
v1:Vector4d

the other vector

Returns:double

the dot product of this vector and vector v1

lengthback to summary
public final double length()

Returns the length of this vector.

Returns:double

the length of this vector

lengthSquaredback to summary
public final double lengthSquared()

Returns the squared length of this vector.

Returns:double

the squared length of this vector

normalizeback to summary
public final void normalize(Vector4d v1)

Sets the value of this vector to the normalization of vector v1.

Parameters
v1:Vector4d

the un-normalized vector

normalizeback to summary
public final void normalize()

Normalizes this vector in place.

setback to summary
public final void set(Tuple3d t1)

Sets the x,y,z components of this vector to the corresponding components of tuple t1. The w component of this vector is set to 0.

Parameters
t1:Tuple3d

the tuple to be copied

Since
vecmath 1.2