Top Description Fields Constructors Methods
javax.vecmath

public abstract Class Tuple4d

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
javax.vecmath.Vector4d, javax.vecmath.Point4d, javax.vecmath.Quat4d
Imports
java.lang.Math

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

Field Summary

Modifier and TypeField and Description
pack-priv static final long
public double
w

The w coordinate.

public double
x

The x coordinate.

public double
y

The y coordinate.

public double
z

The z coordinate.

Constructor Summary

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

Constructs and initializes a Tuple4d from the specified xyzw coordinates.

public
Tuple4d(double[]
the array of length 4 containing xyzw in order
t
)

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

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

Constructs and initializes a Tuple4d from the specified Tuple4d.

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

Constructs and initializes a Tuple4d from the specified Tuple4f.

public
Tuple4d()

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

Method Summary

Modifier and TypeMethod and Description
public final void
absolute(Tuple4d
the source tuple, which will not be modified
t
)

Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.

public final void
absolute()

Sets each component of this tuple to its absolute value.

public final void
add(Tuple4d
the first tuple
t1
,
Tuple4d
the second tuple
t2
)

Sets the value of this tuple to the tuple sum of tuples t1 and t2.

public final void
add(Tuple4d
the other tuple
t1
)

Sets the value of this tuple to the sum of itself and tuple t1.

public final void
clamp(float min, float max, Tuple4d t)

Deprecated Use clamp(double,double,Tuple4d) instead
public final void
clamp(double
the lowest value in the tuple after clamping
min
,
double
the highest value in the tuple after clamping
max
,
Tuple4d
the source tuple, which will not be modified
t
)

Clamps the tuple parameter to the range [low, high] and places the values into this tuple.

public final void
clamp(float min, float max)

Deprecated Use clamp(double,double) instead
public final void
clamp(double
the lowest value in this tuple after clamping
min
,
double
the highest value in this tuple after clamping
max
)

Clamps this tuple to the range [low, high].

public final void
clampMax(float max, Tuple4d t)

Deprecated Use clampMax(double,Tuple4d) instead
public final void
clampMax(double
the highest value in the tuple after clamping
max
,
Tuple4d
the source tuple, which will not be modified
t
)

Clamps the maximum value of the tuple parameter to the max parameter and places the values into this tuple.

public final void
clampMax(float max)

Deprecated Use clampMax(double) instead
public final void
clampMax(double
the highest value in the tuple after clamping
max
)

Clamps the maximum value of this tuple to the max parameter.

public final void
clampMin(float min, Tuple4d t)

Deprecated Use clampMin(double,Tuple4d) instead
public final void
clampMin(double
the lowest value in the tuple after clamping
min
,
Tuple4d
the source tuple, which will not be modified
t
)

Clamps the minimum value of the tuple parameter to the min parameter and places the values into this tuple.

public final void
clampMin(float min)

Deprecated Use clampMin(double) instead
public final void
clampMin(double
the lowest value in this tuple after clamping
min
)

Clamps the minimum value of this tuple to the min parameter.

public Object

Returns:

a clone of this instance.
clone
()

Overrides java.lang.Object.clone.

Creates a new object of the same class as this object.
public boolean

Returns:

true or false
epsilonEquals
(Tuple4d
the tuple to be compared to this tuple
t1
,
double
the threshold value
epsilon
)

Returns true if the L-infinite distance between this tuple and tuple t1 is less than or equal to the epsilon parameter, otherwise returns false.

public boolean

Returns:

true or false
equals
(Tuple4d
the tuple with which the comparison is made
t1
)

Returns true if all of the data members of Tuple4d t1 are equal to the corresponding data members in this Tuple4d.

public boolean

Returns:

true or false
equals
(Object
the object with which the comparison is made
t1
)

Overrides java.lang.Object.equals.

Returns true if the Object t1 is of type Tuple4d and all of the data members of t1 are equal to the corresponding data members in this Tuple4d.
public final void
get(double[]
the array of length four
t
)

Gets the value of this tuple and places it into the array t of length four in x,y,z,w order.

public final void
get(Tuple4d
the Tuple into which the values will be copied
t
)

Gets the value of this tuple and places it into the Tuple4d argument of length four in x,y,z,w order.

public final double

Returns:

the w coordinate.
getW
()

Get the w coordinate.

public final double

Returns:

the x coordinate.
getX
()

Get the x coordinate.

public final double

Returns:

the y coordinate.
getY
()

Get the y coordinate.

public final double

Returns:

the z coordinate.
getZ
()

Get the z coordinate.

public int

Returns:

the integer hash code value
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code value based on the data values in this object.
public void
interpolate(Tuple4d t1, Tuple4d t2, float alpha)

Deprecated Use interpolate(Tuple4d,Tuple4d,double) instead
public void
interpolate(Tuple4d
the first tuple
t1
,
Tuple4d
the second tuple
t2
,
double
the alpha interpolation parameter
alpha
)

Linearly interpolates between tuples t1 and t2 and places the result into this tuple: this = (1-alpha)*t1 + alpha*t2.

public void
interpolate(Tuple4d t1, float alpha)

Deprecated Use interpolate(Tuple4d,double) instead
public void
interpolate(Tuple4d
the first tuple
t1
,
double
the alpha interpolation parameter
alpha
)

Linearly interpolates between this tuple and tuple t1 and places the result into this tuple: this = (1-alpha)*this + alpha*t1.

public final void
negate(Tuple4d
the source tuple
t1
)

Sets the value of this tuple to the negation of tuple t1.

public final void
negate()

Negates the value of this tuple in place.

public final void
scale(double
the scalar value
s
,
Tuple4d
the source tuple
t1
)

Sets the value of this tuple to the scalar multiplication of the scale factor with the tuple t1.

public final void
scale(double
the scalar value
s
)

Sets the value of this tuple to the scalar multiplication of the scale factor with this.

public final void
scaleAdd(double
the scalar value
s
,
Tuple4d
the tuple to be multipled
t1
,
Tuple4d
the tuple to be added
t2
)

Sets the value of this tuple to the scalar multiplication by s of tuple t1 plus tuple t2 (this = s*t1 + t2).

public final void
scaleAdd(float s, Tuple4d t1)

Deprecated Use scaleAdd(double,Tuple4d) instead
public final void
scaleAdd(double
the scalar value
s
,
Tuple4d
the tuple to be added
t1
)

Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).

public final void
set(double
the x coordinate
x
,
double
the y coordinate
y
,
double
the z coordinate
z
,
double
the w coordinate
w
)

Sets the value of this tuple to the specified xyzw coordinates.

public final void
set(double[]
the array of length 4 containing xyzw in order
t
)

Sets the value of this tuple to the specified xyzw coordinates.

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

Sets the value of this tuple to the value of tuple t1.

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

Sets the value of this tuple to the value of tuple t1.

public final void
setW(double
value to w coordinate.
w
)

Set the w coordinate.

public final void
setX(double
value to x coordinate.
x
)

Set the x coordinate.

public final void
setY(double
value to y coordinate.
y
)

Set the y coordinate.

public final void
setZ(double
value to z coordinate.
z
)

Set the z coordinate.

public final void
sub(Tuple4d
the first tuple
t1
,
Tuple4d
the second tuple
t2
)

Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).

public final void
sub(Tuple4d
the other tuple
t1
)

Sets the value of this tuple to the difference of itself and tuple t1 (this = this - t1).

public String

Returns:

the String representation
toString
()

Overrides java.lang.Object.toString.

Returns a string that contains the values of this Tuple4d.
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

serialVersionUIDback to summary
pack-priv static final long serialVersionUID
wback to summary
public double w

The w coordinate.

xback to summary
public double x

The x coordinate.

yback to summary
public double y

The y coordinate.

zback to summary
public double z

The z coordinate.

Constructor Detail

Tuple4dback to summary
public Tuple4d(double x, double y, double z, double w)

Constructs and initializes a Tuple4d 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

Tuple4dback to summary
public Tuple4d(double[] t)

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

Parameters
t:double[]

the array of length 4 containing xyzw in order

Tuple4dback to summary
public Tuple4d(Tuple4d t1)

Constructs and initializes a Tuple4d from the specified Tuple4d.

Parameters
t1:Tuple4d

the Tuple4d containing the initialization x y z w data

Tuple4dback to summary
public Tuple4d(Tuple4f t1)

Constructs and initializes a Tuple4d from the specified Tuple4f.

Parameters
t1:Tuple4f

the Tuple4f containing the initialization x y z w data

Tuple4dback to summary
public Tuple4d()

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

Method Detail

absoluteback to summary
public final void absolute(Tuple4d t)

Sets each component of the tuple parameter to its absolute value and places the modified values into this tuple.

Parameters
t:Tuple4d

the source tuple, which will not be modified

absoluteback to summary
public final void absolute()

Sets each component of this tuple to its absolute value.

addback to summary
public final void add(Tuple4d t1, Tuple4d t2)

Sets the value of this tuple to the tuple sum of tuples t1 and t2.

Parameters
t1:Tuple4d

the first tuple

t2:Tuple4d

the second tuple

addback to summary
public final void add(Tuple4d t1)

Sets the value of this tuple to the sum of itself and tuple t1.

Parameters
t1:Tuple4d

the other tuple

clampback to summary
public final void clamp(float min, float max, Tuple4d t)

Deprecated

Use clamp(double,double,Tuple4d) instead

clampback to summary
public final void clamp(double min, double max, Tuple4d t)

Clamps the tuple parameter to the range [low, high] and places the values into this tuple.

Parameters
min:double

the lowest value in the tuple after clamping

max:double

the highest value in the tuple after clamping

t:Tuple4d

the source tuple, which will not be modified

clampback to summary
public final void clamp(float min, float max)

Deprecated

Use clamp(double,double) instead

clampback to summary
public final void clamp(double min, double max)

Clamps this tuple to the range [low, high].

Parameters
min:double

the lowest value in this tuple after clamping

max:double

the highest value in this tuple after clamping

clampMaxback to summary
public final void clampMax(float max, Tuple4d t)

Deprecated

Use clampMax(double,Tuple4d) instead

clampMaxback to summary
public final void clampMax(double max, Tuple4d t)

Clamps the maximum value of the tuple parameter to the max parameter and places the values into this tuple.

Parameters
max:double

the highest value in the tuple after clamping

t:Tuple4d

the source tuple, which will not be modified

clampMaxback to summary
public final void clampMax(float max)

Deprecated

Use clampMax(double) instead

clampMaxback to summary
public final void clampMax(double max)

Clamps the maximum value of this tuple to the max parameter.

Parameters
max:double

the highest value in the tuple after clamping

clampMinback to summary
public final void clampMin(float min, Tuple4d t)

Deprecated

Use clampMin(double,Tuple4d) instead

clampMinback to summary
public final void clampMin(double min, Tuple4d t)

Clamps the minimum value of the tuple parameter to the min parameter and places the values into this tuple.

Parameters
min:double

the lowest value in the tuple after clamping

t:Tuple4d

the source tuple, which will not be modified

clampMinback to summary
public final void clampMin(float min)

Deprecated

Use clampMin(double) instead

clampMinback to summary
public final void clampMin(double min)

Clamps the minimum value of this tuple to the min parameter.

Parameters
min:double

the lowest value in this tuple after clamping

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Creates a new object of the same class as this object.

Returns:Object

a clone of this instance.

Exceptions
OutOfMemoryError:
if there is not enough memory.
Since
vecmath 1.3
See Also
java.lang.Cloneable
epsilonEqualsback to summary
public boolean epsilonEquals(Tuple4d t1, double epsilon)

Returns true if the L-infinite distance between this tuple and tuple t1 is less than or equal to the epsilon parameter, otherwise returns false. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2), abs(z1-z2), abs(w1-w2)].

Parameters
t1:Tuple4d

the tuple to be compared to this tuple

epsilon:double

the threshold value

Returns:boolean

true or false

equalsback to summary
public boolean equals(Tuple4d t1)

Returns true if all of the data members of Tuple4d t1 are equal to the corresponding data members in this Tuple4d.

Parameters
t1:Tuple4d

the tuple with which the comparison is made

Returns:boolean

true or false

equalsback to summary
public boolean equals(Object t1)

Overrides java.lang.Object.equals.

Returns true if the Object t1 is of type Tuple4d and all of the data members of t1 are equal to the corresponding data members in this Tuple4d.

Parameters
t1:Object

the object with which the comparison is made

Returns:boolean

true or false

getback to summary
public final void get(double[] t)

Gets the value of this tuple and places it into the array t of length four in x,y,z,w order.

Parameters
t:double[]

the array of length four

getback to summary
public final void get(Tuple4d t)

Gets the value of this tuple and places it into the Tuple4d argument of length four in x,y,z,w order.

Parameters
t:Tuple4d

the Tuple into which the values will be copied

getWback to summary
public final double getW()

Get the w coordinate.

Returns:double

the w coordinate.

Since
vecmath 1.5
getXback to summary
public final double getX()

Get the x coordinate.

Returns:double

the x coordinate.

Since
vecmath 1.5
getYback to summary
public final double getY()

Get the y coordinate.

Returns:double

the y coordinate.

Since
vecmath 1.5
getZback to summary
public final double getZ()

Get the z coordinate.

Returns:double

the z coordinate.

Since
vecmath 1.5
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value based on the data values in this object. Two different Tuple4d objects with identical data values (i.e., Tuple4d.equals returns true) will return the same hash code value. Two objects with different data members may return the same hash value, although this is not likely.

Returns:int

the integer hash code value

interpolateback to summary
public void interpolate(Tuple4d t1, Tuple4d t2, float alpha)

Deprecated

Use interpolate(Tuple4d,Tuple4d,double) instead

interpolateback to summary
public void interpolate(Tuple4d t1, Tuple4d t2, double alpha)

Linearly interpolates between tuples t1 and t2 and places the result into this tuple: this = (1-alpha)*t1 + alpha*t2.

Parameters
t1:Tuple4d

the first tuple

t2:Tuple4d

the second tuple

alpha:double

the alpha interpolation parameter

interpolateback to summary
public void interpolate(Tuple4d t1, float alpha)

Deprecated

Use interpolate(Tuple4d,double) instead

interpolateback to summary
public void interpolate(Tuple4d t1, double alpha)

Linearly interpolates between this tuple and tuple t1 and places the result into this tuple: this = (1-alpha)*this + alpha*t1.

Parameters
t1:Tuple4d

the first tuple

alpha:double

the alpha interpolation parameter

negateback to summary
public final void negate(Tuple4d t1)

Sets the value of this tuple to the negation of tuple t1.

Parameters
t1:Tuple4d

the source tuple

negateback to summary
public final void negate()

Negates the value of this tuple in place.

scaleback to summary
public final void scale(double s, Tuple4d t1)

Sets the value of this tuple to the scalar multiplication of the scale factor with the tuple t1.

Parameters
s:double

the scalar value

t1:Tuple4d

the source tuple

scaleback to summary
public final void scale(double s)

Sets the value of this tuple to the scalar multiplication of the scale factor with this.

Parameters
s:double

the scalar value

scaleAddback to summary
public final void scaleAdd(double s, Tuple4d t1, Tuple4d t2)

Sets the value of this tuple to the scalar multiplication by s of tuple t1 plus tuple t2 (this = s*t1 + t2).

Parameters
s:double

the scalar value

t1:Tuple4d

the tuple to be multipled

t2:Tuple4d

the tuple to be added

scaleAddback to summary
public final void scaleAdd(float s, Tuple4d t1)

Deprecated

Use scaleAdd(double,Tuple4d) instead

scaleAddback to summary
public final void scaleAdd(double s, Tuple4d t1)

Sets the value of this tuple to the scalar multiplication of itself and then adds tuple t1 (this = s*this + t1).

Parameters
s:double

the scalar value

t1:Tuple4d

the tuple to be added

setback to summary
public final void set(double x, double y, double z, double w)

Sets the value of this tuple to 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

setback to summary
public final void set(double[] t)

Sets the value of this tuple to the specified xyzw coordinates.

Parameters
t:double[]

the array of length 4 containing xyzw in order

setback to summary
public final void set(Tuple4d t1)

Sets the value of this tuple to the value of tuple t1.

Parameters
t1:Tuple4d

the tuple to be copied

setback to summary
public final void set(Tuple4f t1)

Sets the value of this tuple to the value of tuple t1.

Parameters
t1:Tuple4f

the tuple to be copied

setWback to summary
public final void setW(double w)

Set the w coordinate.

Parameters
w:double

value to w coordinate.

Since
vecmath 1.5
setXback to summary
public final void setX(double x)

Set the x coordinate.

Parameters
x:double

value to x coordinate.

Since
vecmath 1.5
setYback to summary
public final void setY(double y)

Set the y coordinate.

Parameters
y:double

value to y coordinate.

Since
vecmath 1.5
setZback to summary
public final void setZ(double z)

Set the z coordinate.

Parameters
z:double

value to z coordinate.

Since
vecmath 1.5
subback to summary
public final void sub(Tuple4d t1, Tuple4d t2)

Sets the value of this tuple to the difference of tuples t1 and t2 (this = t1 - t2).

Parameters
t1:Tuple4d

the first tuple

t2:Tuple4d

the second tuple

subback to summary
public final void sub(Tuple4d t1)

Sets the value of this tuple to the difference of itself and tuple t1 (this = this - t1).

Parameters
t1:Tuple4d

the other tuple

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string that contains the values of this Tuple4d. The form is (x,y,z,w).

Returns:String

the String representation