javax.robotics.vecmath
Class RVector3d

java.lang.Object
  extended by javax.vecmath.Tuple3d
      extended by javax.vecmath.Vector3d
          extended by javax.robotics.vecmath.RVector3d
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class RVector3d
extends javax.vecmath.Vector3d

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. This class extend printing functionality of Vector3d class.

Since:
1.0.1
Version:
5/10/2005
Author:
Carmine Lia
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.vecmath.Tuple3d
x, y, z
 
Constructor Summary
RVector3d()
          Constructs and initializes a RVector3d to (0,0,0).
RVector3d(double[] vector)
          Constructs and initializes a RVector3d from the array of length 3.
RVector3d(double x, double y, double z)
          Constructs and initializes a RVector3d from the specified xyz coordinates.
RVector3d(RVector3d vector)
          Constructs and initializes a RVector3d from the specified RVector3d.
RVector3d(javax.vecmath.Vector3d vector)
          Constructs and initializes a RVector3d from the specified Vector3d.
 
Method Summary
 void mul(DMatrix D, RVector3d v)
          Multiplies diagonal matrix D times RVector v and places the result into this vector (this = D*v).
 void mul(RMatrix3d m, RVector3d v)
          Multiplies matrix m times RVector v and places the result into this vector (this = m*v).
 void printf()
          Prints to standard out
 void printf(java.io.PrintStream out)
          Prints to PrintStream
 void printf(java.io.PrintStream out, java.lang.String format)
          Prints to PrintStream according to the format string
 void printf(java.lang.String format)
          Prints to standard out according to the format string.
 java.lang.String toString()
          Returns a string that contains the values of this RVector.
 java.lang.String toString(java.lang.String format)
          Returns a string that contains the values of this RVector, according to the format string
 
Methods inherited from class javax.vecmath.Vector3d
angle, cross, dot, length, lengthSquared, normalize, normalize
 
Methods inherited from class javax.vecmath.Tuple3d
absolute, absolute, add, add, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, clone, epsilonEquals, equals, equals, get, get, hashCode, interpolate, interpolate, interpolate, interpolate, negate, negate, scale, scale, scaleAdd, scaleAdd, scaleAdd, set, set, set, set, sub, sub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RVector3d

public RVector3d(RVector3d vector)
Constructs and initializes a RVector3d from the specified RVector3d.

Parameters:
vector - the RVector3d containing the initialization x y z data

RVector3d

public RVector3d(javax.vecmath.Vector3d vector)
Constructs and initializes a RVector3d from the specified Vector3d.

Parameters:
vector - the Vector3d containing the initialization x y z data

RVector3d

public RVector3d(double[] vector)
Constructs and initializes a RVector3d from the array of length 3.

Parameters:
vector - the array of length 3 containing xyz in order

RVector3d

public RVector3d(double x,
                 double y,
                 double z)
Constructs and initializes a RVector3d from the specified xyz coordinates.

Parameters:
x - the x coordinate
y - the y coordinate
z - the z coordinate

RVector3d

public RVector3d()
Constructs and initializes a RVector3d to (0,0,0).

Method Detail

mul

public void mul(RMatrix3d m,
                RVector3d v)
Multiplies matrix m times RVector v and places the result into this vector (this = m*v).

Parameters:
m - the input matrix
v - the input vector

printf

public void printf()
Prints to standard out


printf

public void printf(java.lang.String format)
Prints to standard out according to the format string.

The format specifiers for numeric types have the following syntax:

 %[width][.precision]conversion
 

Example:
v.printf("%5.3f");

Parameters:
format - The format string
See Also:
PrintStream.format(java.lang.String, java.lang.Object[])

printf

public void printf(java.io.PrintStream out)
Prints to PrintStream

Parameters:
out - The PrintStream object.

printf

public void printf(java.io.PrintStream out,
                   java.lang.String format)
Prints to PrintStream according to the format string

Parameters:
out - The PrintStream object.
format - The format string.
See Also:
printf(String)

toString

public java.lang.String toString()
Returns a string that contains the values of this RVector.

Overrides:
toString in class javax.vecmath.Tuple3d
Returns:
The string.

toString

public java.lang.String toString(java.lang.String format)
Returns a string that contains the values of this RVector, according to the format string

Parameters:
format - The format string
Returns:
The string
See Also:
printf(String)

mul

public void mul(DMatrix D,
                RVector3d v)
Multiplies diagonal matrix D times RVector v and places the result into this vector (this = D*v).

Parameters:
D - The diagonal matrix in the multiplication
v - The vector that is multiplied