Package javax.vecmath
Class AxisAngle4d
java.lang.Object
javax.vecmath.AxisAngle4d
- All Implemented Interfaces:
Serializable
,Cloneable
A four-element axis angle represented by double-precision floating point
x,y,z,angle components. An axis angle is a rotation of angle (radians)
about the vector (x,y,z).
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs and initializes an AxisAngle4d to (0,0,1,0).AxisAngle4d
(double[] a) Constructs and initializes an AxisAngle4d from the components contained in the array.AxisAngle4d
(double x, double y, double z, double angle) Constructs and initializes an AxisAngle4d from the specified x, y, z, and angle.Constructs and initializes an AxisAngle4d from the specified AxisAngle4d.Constructs and initializes an AxisAngle4d from the specified AxisAngle4f.AxisAngle4d
(Vector3d axis, double angle) Constructs and initializes an AxisAngle4d from the specified axis and angle. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a new object of the same class as this object.boolean
epsilonEquals
(AxisAngle4d a1, double epsilon) Returns true if the L-infinite distance between this axis-angle and axis-angle a1 is less than or equal to the epsilon parameter, otherwise returns false.boolean
Returns true if the Object o1 is of type AxisAngle4d and all of the data members of o1 are equal to the corresponding data members in this AxisAngle4d.boolean
equals
(AxisAngle4d a1) Returns true if all of the data members of AxisAngle4d a1 are equal to the corresponding data members in this AxisAngle4d.final void
get
(double[] a) Gets the value of this axis angle and places it into the array a of length four in x,y,z,angle order.final double
getAngle()
Get the axis angle, in radians.
An axis angle is a rotation angle about the vector (x,y,z).double
getX()
Get value of x coordinate.final double
getY()
Get value of y coordinate.double
getZ()
Get value of z coordinate.int
hashCode()
Returns a hash code value based on the data values in this object.final void
set
(double[] a) Sets the value of this axis angle to the specified x,y,z,angle.final void
set
(double x, double y, double z, double angle) Sets the value of this axis angle to the specified x,y,z,angle.final void
set
(AxisAngle4d a1) Sets the value of this axis angle to the value of axis angle a1.final void
set
(AxisAngle4f a1) Sets the value of this axis angle to the value of axis angle a1.final void
Sets the value of this axis-angle to the rotational component of the passed matrix.final void
Sets the value of this axis-angle to the rotational component of the passed matrix.final void
Sets the value of this axis-angle to the rotational component of the passed matrix.final void
Sets the value of this axis-angle to the rotational component of the passed matrix.final void
Sets the value of this axis-angle to the rotational equivalent of the passed quaternion.final void
Sets the value of this axis-angle to the rotational equivalent of the passed quaternion.final void
Sets the value of this AxisAngle4d to the specified axis and angle.final void
setAngle
(double angle) Set the axis angle, in radians.
An axis angle is a rotation angle about the vector (x,y,z).final void
setX
(double x) Set a new value for x coordinate.final void
setY
(double y) Set a new value for y coordinate.final void
setZ
(double z) Set a new value for z coordinate.toString()
Returns a string that contains the values of this AxisAngle4d.
-
Field Details
-
x
public double xThe x coordinate. -
y
public double yThe y coordinate. -
z
public double zThe z coordinate. -
angle
public double angleThe angle of rotation in radians.
-
-
Constructor Details
-
AxisAngle4d
public AxisAngle4d(double x, double y, double z, double angle) Constructs and initializes an AxisAngle4d from the specified x, y, z, and angle.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinateangle
- the angle of rotation in radians
-
AxisAngle4d
public AxisAngle4d(double[] a) Constructs and initializes an AxisAngle4d from the components contained in the array.- Parameters:
a
- the array of length 4 containing x,y,z,angle in order
-
AxisAngle4d
Constructs and initializes an AxisAngle4d from the specified AxisAngle4d.- Parameters:
a1
- the AxisAngle4d containing the initialization x y z angle data
-
AxisAngle4d
Constructs and initializes an AxisAngle4d from the specified AxisAngle4f.- Parameters:
a1
- the AxisAngle4f containing the initialization x y z angle data
-
AxisAngle4d
Constructs and initializes an AxisAngle4d from the specified axis and angle.- Parameters:
axis
- the axisangle
- the angle of rotation in radian- Since:
- vecmath 1.2
-
AxisAngle4d
public AxisAngle4d()Constructs and initializes an AxisAngle4d to (0,0,1,0).
-
-
Method Details
-
set
public final void set(double x, double y, double z, double angle) Sets the value of this axis angle to the specified x,y,z,angle.- Parameters:
x
- the x coordinatey
- the y coordinatez
- the z coordinateangle
- the angle of rotation in radians
-
set
public final void set(double[] a) Sets the value of this axis angle to the specified x,y,z,angle.- Parameters:
a
- the array of length 4 containing x,y,z,angle in order
-
set
Sets the value of this axis angle to the value of axis angle a1.- Parameters:
a1
- the axis angle to be copied
-
set
Sets the value of this axis angle to the value of axis angle a1.- Parameters:
a1
- the axis angle to be copied
-
set
Sets the value of this AxisAngle4d to the specified axis and angle.- Parameters:
axis
- the axisangle
- the angle of rotation in radians- Since:
- vecmath 1.2
-
get
public final void get(double[] a) Gets the value of this axis angle and places it into the array a of length four in x,y,z,angle order.- Parameters:
a
- the array of length four
-
set
Sets the value of this axis-angle to the rotational component of the passed matrix. If the specified matrix has no rotational component, the value of this AxisAngle4d is set to an angle of 0 about an axis of (0,1,0).- Parameters:
m1
- the matrix4f
-
set
Sets the value of this axis-angle to the rotational component of the passed matrix. If the specified matrix has no rotational component, the value of this AxisAngle4d is set to an angle of 0 about an axis of (0,1,0).- Parameters:
m1
- the matrix4d
-
set
Sets the value of this axis-angle to the rotational component of the passed matrix. If the specified matrix has no rotational component, the value of this AxisAngle4d is set to an angle of 0 about an axis of (0,1,0).- Parameters:
m1
- the matrix3f
-
set
Sets the value of this axis-angle to the rotational component of the passed matrix. If the specified matrix has no rotational component, the value of this AxisAngle4d is set to an angle of 0 about an axis of (0,1,0).- Parameters:
m1
- the matrix3d
-
set
Sets the value of this axis-angle to the rotational equivalent of the passed quaternion. If the specified quaternion has no rotational component, the value of this AxisAngle4d is set to an angle of 0 about an axis of (0,1,0).- Parameters:
q1
- the Quat4f
-
set
Sets the value of this axis-angle to the rotational equivalent of the passed quaternion. If the specified quaternion has no rotational component, the value of this AxisAngle4d is set to an angle of 0 about an axis of (0,1,0).- Parameters:
q1
- the Quat4d
-
toString
Returns a string that contains the values of this AxisAngle4d. The form is (x,y,z,angle). -
equals
Returns true if all of the data members of AxisAngle4d a1 are equal to the corresponding data members in this AxisAngle4d.- Parameters:
a1
- the axis-angle with which the comparison is made- Returns:
- true or false
-
equals
Returns true if the Object o1 is of type AxisAngle4d and all of the data members of o1 are equal to the corresponding data members in this AxisAngle4d. -
epsilonEquals
Returns true if the L-infinite distance between this axis-angle and axis-angle a1 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(angle1-angle2)].- Parameters:
a1
- the axis-angle to be compared to this axis-angleepsilon
- the threshold value
-
hashCode
public int hashCode()Returns a hash code value based on the data values in this object. Two different AxisAngle4d objects with identical data values (i.e., AxisAngle4d.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. -
clone
Creates a new object of the same class as this object.- Overrides:
clone
in classObject
- Returns:
- a clone of this instance.
- Throws:
OutOfMemoryError
- if there is not enough memory.- Since:
- vecmath 1.3
- See Also:
-
getAngle
public final double getAngle()Get the axis angle, in radians.
An axis angle is a rotation angle about the vector (x,y,z).- Returns:
- the angle, in radians.
- Since:
- vecmath 1.5
-
setAngle
public final void setAngle(double angle) Set the axis angle, in radians.
An axis angle is a rotation angle about the vector (x,y,z).- Parameters:
angle
- The angle to set, in radians.- Since:
- vecmath 1.5
-
getX
public double getX()Get value of x coordinate.- Returns:
- the x coordinate.
- Since:
- vecmath 1.5
-
setX
public final void setX(double x) Set a new value for x coordinate.- Parameters:
x
- the x coordinate.- Since:
- vecmath 1.5
-
getY
public final double getY()Get value of y coordinate.- Returns:
- the y coordinate.
- Since:
- vecmath 1.5
-
setY
public final void setY(double y) Set a new value for y coordinate.- Parameters:
y
- the y coordinate.- Since:
- vecmath 1.5
-
getZ
public double getZ()Get value of z coordinate.- Returns:
- the z coordinate.
- Since:
- vecmath 1.5
-
setZ
public final void setZ(double z) Set a new value for z coordinate.- Parameters:
z
- the z coordinate.- Since:
- vecmath 1.5
-