maspack.spatialmotion
Class Wrench

java.lang.Object
  extended bymaspack.matrix.VectorObject
      extended bymaspack.spatialmotion.SpatialVector
          extended bymaspack.spatialmotion.Wrench
All Implemented Interfaces:
java.io.Serializable

public class Wrench
extends SpatialVector

A spatial vector that represents a spatial force, comprised of a translation force f and a moment m. A wrench is a covariant spatial vector, with m being the free vector and f being the line vector.

See Also:
Serialized Form

Field Summary
 Vector3d f
          Translational force
 Vector3d m
          Moment (rotational force)
 
Constructor Summary
Wrench()
          Creates a Wrench and initializes its contents to zero.
Wrench(double fx, double fy, double fz, double mx, double my, double mz)
          Creates a Wrench and initializes its components to the specified values.
Wrench(Vector3d f, Vector3d m)
          Creates a Wrench and initializes its components to the specified values.
Wrench(Wrench wr)
          Creates a Wrench and initializes its contents to the values of an existing Wrench.
 
Method Summary
 void absolute(Wrench wr1)
          Sets the elements of this wrench to their absolute values.
 void add(Wrench wr1)
          Adds this wrench to wr1 and places the result in this wrench.
 void add(Wrench wr1, Wrench wr2)
          Adds wrench wr1 to wr2 and places the result in this wrench.
 void combine(double s1, Wrench wr1, double s2, Wrench wr2)
          Computes s1 wr1 + s2 wr2 and places the result in this wrench.
 void interpolate(double s, Wrench wr1)
          Computes the interpolation (1-s) this + s wr1 and places the result in this wrench.
 void interpolate(Wrench wr1, double s, Wrench wr2)
          Computes the interpolation (1-s) wr1 + s wr2 and places the result in this wrench.
 void inverseTransform(RigidTransform3d X, Wrench wr1)
          Applies an inverse rigid spatial transformation to the wrench wr1, and places the result in this wrench.
 void inverseTransform(RotationMatrix3d R, Wrench wr1)
          Applies an inverse rotational transformation to the wrench wr1, and stores the result in this wrench.
 void negate(Wrench wr1)
          Sets this wrench to the negative of wr1.
 void normalize(Wrench wr1)
          Computes a unit wrench in the direction of wr1 and places the result in this wrench.
 void scale(double s, Wrench wr1)
          Scales the elements of wrench wr1 by s and places the results in this wrench.
 void scaleAdd(double s, Wrench wr1)
          Computes s this + wr1 and places the result in this wrench.
 void scaleAdd(double s, Wrench wr1, Wrench wr2)
          Computes s wr1 + wr2 and places the result in this wrench.
 void set(double fx, double fy, double fz, double mx, double my, double mz)
          Sets the values of this wrench to the specified component values.
 void set(Vector3d f, Vector3d m)
          Sets the values of this wrench to the specified component values.
 void set(Wrench wr)
          Sets the values of this wrench to those of wrench tw.
 void sub(Wrench wr1)
          Subtracts wr1 from this wrench and places the result in this wrench.
 void sub(Wrench wr1, Wrench wr2)
          Subtracts wrench wr1 from wr2 and places the result in this wrench.
 void transform(RigidTransform3d X, Wrench wr1)
          Applies a rigid spatial transformation to the wrench wr1, and places the result in this wrench.
 void transform(RotationMatrix3d R, Wrench wr1)
          Applies a rotational transformation to the wrench wr1 and stores the result in this wrench.
 
Methods inherited from class maspack.spatialmotion.SpatialVector
absolute, dot, epsilonEquals, equals, get, get, infinityNorm, inverseTransform, inverseTransform, isContravariant, maxElement, minElement, negate, norm, normalize, normSquared, oneNorm, scale, set, set, setRandom, setRandom, setRandom, setZero, size, toString, transform, transform
 
Methods inherited from class maspack.matrix.VectorObject
dot, epsilonEquals, equals, equals, get, isFixedSize, scan, set, setSize, toString, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

f

public final Vector3d f
Translational force


m

public final Vector3d m
Moment (rotational force)

Constructor Detail

Wrench

public Wrench()
Creates a Wrench and initializes its contents to zero.


Wrench

public Wrench(Wrench wr)
Creates a Wrench and initializes its contents to the values of an existing Wrench.

Parameters:
wr - wrench whose values are to be copied

Wrench

public Wrench(double fx,
              double fy,
              double fz,
              double mx,
              double my,
              double mz)
Creates a Wrench and initializes its components to the specified values.

Parameters:
fx - force x component
fy - force y component
fz - force z component
mx - moment x component
my - moment y component
mz - moment z component

Wrench

public Wrench(Vector3d f,
              Vector3d m)
Creates a Wrench and initializes its components to the specified values.

Parameters:
f - force
m - moment
Method Detail

set

public void set(double fx,
                double fy,
                double fz,
                double mx,
                double my,
                double mz)
Sets the values of this wrench to the specified component values.

Parameters:
fx - force x component
fy - force y component
fz - force z component
mx - moment x component
my - moment y component
mz - moment z component

set

public void set(Vector3d f,
                Vector3d m)
Sets the values of this wrench to the specified component values.

Parameters:
f - force
m - moment

set

public void set(Wrench wr)
Sets the values of this wrench to those of wrench tw.

Parameters:
wr - wrench whose values are to be copied

add

public void add(Wrench wr1,
                Wrench wr2)
Adds wrench wr1 to wr2 and places the result in this wrench.

Parameters:
wr1 - left-hand wrench
wr2 - right-hand wrench

add

public void add(Wrench wr1)
Adds this wrench to wr1 and places the result in this wrench.

Parameters:
wr1 - right-hand wrench

sub

public void sub(Wrench wr1,
                Wrench wr2)
Subtracts wrench wr1 from wr2 and places the result in this wrench.

Parameters:
wr1 - left-hand wrench
wr2 - right-hand wrench

sub

public void sub(Wrench wr1)
Subtracts wr1 from this wrench and places the result in this wrench.

Parameters:
wr1 - right-hand wrench

negate

public void negate(Wrench wr1)
Sets this wrench to the negative of wr1.

Parameters:
wr1 - wrench to negate

scale

public void scale(double s,
                  Wrench wr1)
Scales the elements of wrench wr1 by s and places the results in this wrench.

Parameters:
s - scaling factor
wr1 - wrench to be scaled

interpolate

public void interpolate(Wrench wr1,
                        double s,
                        Wrench wr2)
Computes the interpolation (1-s) wr1 + s wr2 and places the result in this wrench.

Parameters:
wr1 - left-hand wrench
s - interpolation factor
wr2 - right-hand wrench

interpolate

public void interpolate(double s,
                        Wrench wr1)
Computes the interpolation (1-s) this + s wr1 and places the result in this wrench.

Parameters:
s - interpolation factor
wr1 - right-hand wrench

scaleAdd

public void scaleAdd(double s,
                     Wrench wr1,
                     Wrench wr2)
Computes s wr1 + wr2 and places the result in this wrench.

Parameters:
s - scaling factor
wr1 - wrench to be scaled
wr2 - wrench to be added

scaleAdd

public void scaleAdd(double s,
                     Wrench wr1)
Computes s this + wr1 and places the result in this wrench.

Parameters:
s - scaling factor
wr1 - wrench to be added

combine

public void combine(double s1,
                    Wrench wr1,
                    double s2,
                    Wrench wr2)
Computes s1 wr1 + s2 wr2 and places the result in this wrench.

Parameters:
s1 - left-hand scaling factor
wr1 - left-hand wrench
s2 - right-hand scaling factor
wr2 - right-hand wrench

normalize

public void normalize(Wrench wr1)
Computes a unit wrench in the direction of wr1 and places the result in this wrench.

Parameters:
wr1 - wrench to normalize

absolute

public void absolute(Wrench wr1)
Sets the elements of this wrench to their absolute values.


transform

public void transform(RotationMatrix3d R,
                      Wrench wr1)
Applies a rotational transformation to the wrench wr1 and stores the result in this wrench.

Parameters:
R - rotational transformation matrix
wr1 - wrench to transform

inverseTransform

public void inverseTransform(RotationMatrix3d R,
                             Wrench wr1)
Applies an inverse rotational transformation to the wrench wr1, and stores the result in this wrench.

Parameters:
R - rotational transformation matrix
wr1 - wrench to transform

transform

public void transform(RigidTransform3d X,
                      Wrench wr1)
Applies a rigid spatial transformation to the wrench wr1, and places the result in this wrench.

Parameters:
X - rigid spatial transformation
wr1 - wrench to be transformed

inverseTransform

public void inverseTransform(RigidTransform3d X,
                             Wrench wr1)
Applies an inverse rigid spatial transformation to the wrench wr1, and places the result in this wrench.

Parameters:
X - rigid spatial transformation
wr1 - wrench to be transformed