Top Description Fields Constructors Methods
javax.vecmath

public Class Vector3d

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

A 3-element vector that is represented by double-precision floating point x,y,z coordinates. If this value represents a normal, then it should be normalized.

Field Summary

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

Constructor Summary

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

Constructs and initializes a Vector3d from the specified xyz coordinates.

public
Vector3d(double[]
the array of length 3 containing xyz in order
v
)

Constructs and initializes a Vector3d from the array of length 3.

public
Vector3d(Vector3d
the Vector3d containing the initialization x y z data
v1
)

Constructs and initializes a Vector3d from the specified Vector3d.

public
Vector3d(Vector3f
the Vector3f containing the initialization x y z data
v1
)

Constructs and initializes a Vector3d from the specified Vector3f.

public
Vector3d(Tuple3f
the Tuple3f containing the initialization x y z data
t1
)

Constructs and initializes a Vector3d from the specified Tuple3f.

public
Vector3d(Tuple3d
the Tuple3d containing the initialization x y z data
t1
)

Constructs and initializes a Vector3d from the specified Tuple3d.

public
Vector3d()

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

Method Summary

Modifier and TypeMethod and Description
public final double

Returns:

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

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

public final void
cross(Vector3d
the first vector
v1
,
Vector3d
the second vector
v2
)

Sets this vector to the vector cross product of vectors v1 and v2.

public final double

Returns:

the dot product of this and v1
dot
(Vector3d
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(Vector3d
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.

Inherited from javax.vecmath.Tuple3d:
absoluteabsoluteaddaddclampclampclampclampclampMaxclampMaxclampMaxclampMaxclampMinclampMinclampMinclampMincloneepsilonEqualsequalsequalsgetgetgetXgetYgetZhashCodeinterpolateinterpolateinterpolateinterpolatenegatenegatescalescalescaleAddscaleAddscaleAddsetsetsetsetsetXsetYsetZsubsubtoString

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides javax.vecmath.Tuple3d.serialVersionUID.

Constructor Detail

Vector3dback to summary
public Vector3d(double x, double y, double z)

Constructs and initializes a Vector3d from the specified xyz coordinates.

Parameters
x:double

the x coordinate

y:double

the y coordinate

z:double

the z coordinate

Vector3dback to summary
public Vector3d(double[] v)

Constructs and initializes a Vector3d from the array of length 3.

Parameters
v:double[]

the array of length 3 containing xyz in order

Vector3dback to summary
public Vector3d(Vector3d v1)

Constructs and initializes a Vector3d from the specified Vector3d.

Parameters
v1:Vector3d

the Vector3d containing the initialization x y z data

Vector3dback to summary
public Vector3d(Vector3f v1)

Constructs and initializes a Vector3d from the specified Vector3f.

Parameters
v1:Vector3f

the Vector3f containing the initialization x y z data

Vector3dback to summary
public Vector3d(Tuple3f t1)

Constructs and initializes a Vector3d from the specified Tuple3f.

Parameters
t1:Tuple3f

the Tuple3f containing the initialization x y z data

Vector3dback to summary
public Vector3d(Tuple3d t1)

Constructs and initializes a Vector3d from the specified Tuple3d.

Parameters
t1:Tuple3d

the Tuple3d containing the initialization x y z data

Vector3dback to summary
public Vector3d()

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

Method Detail

angleback to summary
public final double angle(Vector3d v1)

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

Parameters
v1:Vector3d

the other vector

Returns:double

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

crossback to summary
public final void cross(Vector3d v1, Vector3d v2)

Sets this vector to the vector cross product of vectors v1 and v2.

Parameters
v1:Vector3d

the first vector

v2:Vector3d

the second vector

dotback to summary
public final double dot(Vector3d v1)

Returns the dot product of this vector and vector v1.

Parameters
v1:Vector3d

the other vector

Returns:double

the dot product of this and 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(Vector3d v1)

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

Parameters
v1:Vector3d

the un-normalized vector

normalizeback to summary
public final void normalize()

Normalizes this vector in place.