Package javajs.util
Class T3d
java.lang.Object
javajs.util.T3d
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
V3d
A generic 3 element tuple that is represented by double precision floating
point x,y and z coordinates.
- Version:
- specification 1.1, implementation $Revision: 1.9 $, $Date: 2006/07/28 17:01:32 $
- Author:
- Kenji hiranabe additions by Bob Hanson hansonr@stolaf.edu 9/30/2012 for unique constructor and method names for the optimization of compiled JavaScript using Java2Script
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Sets the value of this tuple to the vector sum of itself and tuple t1.final void
Sets the value of this tuple to the vector sum of tuples t1 and t2.boolean
Returns true if all of the data members of Tuple3d t1 are equal to the corresponding data members in thisint
hashCode()
Returns a hash number based on the data values in this object.final void
scale
(double s) Sets the value of this tuple to the scalar multiplication of itself.final void
Sets the value of this tuple to the scalar multiplication of tuple t1 and then adds tuple t2 (this = s*t1 + t2).final void
Sets the value of this tuple to the scalar multiplication of tuple t1 and then adds tuple t2 (this = s*t1 + t2).final void
set
(double x, double y, double z) Sets the value of this tuple to the specified xyz coordinates.final void
setA
(double[] t) Sets the value of this tuple from the 3 values specified in the array.final void
Sets the value of this tuple to the value of the Tuple3d argument.final void
Sets the value of this tuple to the vector difference of itself and tuple t1 (this = this - t1).final void
Sets the value of this tuple to the vector difference of tuple t1 and t2 (this = t1 - t2).toString()
Returns a string that contains the values of this Tuple3d.
-
Field Details
-
x
public double xThe x coordinate. -
y
public double yThe y coordinate. -
z
public double zThe z coordinate.
-
-
Constructor Details
-
T3d
public T3d()Constructs and initializes a Tuple3d to (0,0,0).
-
-
Method Details
-
set
public final void set(double x, double y, double z) Sets the value of this tuple to the specified xyz coordinates.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinate
-
setA
public final void setA(double[] t) Sets the value of this tuple from the 3 values specified in the array.- Parameters:
t
- the array of length 3 containing xyz in order
-
setT
Sets the value of this tuple to the value of the Tuple3d argument.- Parameters:
t1
- the tuple to be copied
-
add2
Sets the value of this tuple to the vector sum of tuples t1 and t2.- Parameters:
t1
- the first tuplet2
- the second tuple
-
add
Sets the value of this tuple to the vector sum of itself and tuple t1.- Parameters:
t1
- the other tuple
-
sub2
Sets the value of this tuple to the vector difference of tuple t1 and t2 (this = t1 - t2).- Parameters:
t1
- the first tuplet2
- the second tuple
-
sub
Sets the value of this tuple to the vector difference of itself and tuple t1 (this = this - t1).- Parameters:
t1
- the other tuple
-
scale
public final void scale(double s) Sets the value of this tuple to the scalar multiplication of itself.- Parameters:
s
- the scalar value
-
scaleAdd
Sets the value of this tuple to the scalar multiplication of tuple t1 and then adds tuple t2 (this = s*t1 + t2).- Parameters:
s
- the scalar valuet1
- the tuple to be multipledt2
- the tuple to be added
-
scaleAdd2
Sets the value of this tuple to the scalar multiplication of tuple t1 and then adds tuple t2 (this = s*t1 + t2).- Parameters:
s
- the scalar valuet1
- the tuple to be multipledt2
- the tuple to be added
-
hashCode
public int hashCode()Returns a hash number based on the data values in this object. Two different Tuple3d objects with identical data values (ie, returns true for equals(Tuple3d) ) will return the same hash number. Two vectors with different data members may return the same hash value, although this is not likely. -
equals
Returns true if all of the data members of Tuple3d t1 are equal to the corresponding data members in this -
toString
Returns a string that contains the values of this Tuple3d. The form is (x,y,z).
-