maspack.geometry

## Class ScaledRigidTransformer3d

• java.lang.Object
• maspack.geometry.ScaledRigidTransformer3d
• All Implemented Interfaces:
VectorTransformer3d

```public class ScaledRigidTransformer3d
extends java.lang.Object
implements VectorTransformer3d```
Implements an affine transformation defined in homogeneous coordinates by
```  [  R S  p ]
[         ]
[   0   1 ]
```
where `R` is a 3x3 rotation, `S` is a diagonal scaling matrix, and `p` is a translation offset.
• ### Constructor Summary

Constructors
Constructor and Description
```ScaledRigidTransformer3d(Vector3d scaling, RigidTransform3d T)```
```ScaledRigidTransformer3d(Vector3d scaling, RotationMatrix3d R, Vector3d origin)```
• ### Method Summary

All Methods
Modifier and Type Method and Description
`ScaledRigidTransformer3d` `copy()`
Creates and returns a copy of this transformer.
`void` `getOrigin(Vector3d p)`
`void` `getRigidTransform(RigidTransform3d T)`
`void` `getRotation(RotationMatrix3d R)`
`void` `getScaling(Vector3d scaling)`
`void` ```inverseTransformCovec(Vector3d nr, Vector3d n0)```
Applies an inverse transform to covector `c0` and places the result in `cr`.
`void` ```inverseTransformPnt(Vector3d pr, Vector3d p0)```
Applies an inverse transform to point `p0` and places the result in `pr`.
`void` ```inverseTransformVec(Vector3d vr, Vector3d v0)```
Applies an inverse transform to vector `v0` and places the result in `vr`.
`boolean` `isAffine()`
Returns `true` if this transformer implements a linear affine transform.
`boolean` `isRigid()`
Returns `true` if this transformer implements a linear rigid transform.
`void` `scaleDistance(double s)`
Scale the distance units associated with this transformer.
`void` ```set(Vector3d scaling, RotationMatrix3d R, Vector3d p)```
`java.lang.String` `toString(java.lang.String fmtStr)`
Returns a string representation of this transformer.
`void` ```transformCovec(Vector3d nr, Vector3d n0)```
Transforms a covector `c0` and places the result in `cr`.
`void` ```transformPnt(Vector3d pr, Vector3d p0)```
Transforms point `p0` and places the result in `pr`.
`void` ```transformVec(Vector3d vr, Vector3d v0)```
Transforms vector `v0` and places the result in `vr`.
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### ScaledRigidTransformer3d

```public ScaledRigidTransformer3d(Vector3d scaling,
RigidTransform3d T)```
• #### ScaledRigidTransformer3d

```public ScaledRigidTransformer3d(Vector3d scaling,
RotationMatrix3d R,
Vector3d origin)```
• ### Method Detail

• #### set

```public void set(Vector3d scaling,
RotationMatrix3d R,
Vector3d p)```
• #### getScaling

`public void getScaling(Vector3d scaling)`
• #### getOrigin

`public void getOrigin(Vector3d p)`
• #### getRotation

`public void getRotation(RotationMatrix3d R)`
• #### getRigidTransform

`public void getRigidTransform(RigidTransform3d T)`
• #### transformPnt

```public void transformPnt(Vector3d pr,
Vector3d p0)```
Transforms point `p0` and places the result in `pr`.
Specified by:
`transformPnt` in interface `VectorTransformer3d`
Parameters:
`pr` - returns the transformed point
`p0` - point to be transformed
• #### transformVec

```public void transformVec(Vector3d vr,
Vector3d v0)```
Transforms vector `v0` and places the result in `vr`.
Specified by:
`transformVec` in interface `VectorTransformer3d`
Parameters:
`vr` - returns the transformed vector
`v0` - vector to be transformed
• #### transformCovec

```public void transformCovec(Vector3d nr,
Vector3d n0)```
Transforms a covector `c0` and places the result in `cr`. If a vector is transformed linearly according to
```   vr = A v0,
```
then the covector will be transformed according to
```         -1 T
cr = A     c0,
```
Normal vectors and gradients are generally transformed as covectors. In the case of normals, the application will need to normalize the result if this transformation is not rigid.
Specified by:
`transformCovec` in interface `VectorTransformer3d`
Parameters:
`nr` - returns the transformed covector
`n0` - normal to be transformed
• #### inverseTransformPnt

```public void inverseTransformPnt(Vector3d pr,
Vector3d p0)```
Applies an inverse transform to point `p0` and places the result in `pr`.
Specified by:
`inverseTransformPnt` in interface `VectorTransformer3d`
Parameters:
`pr` - returns the transformed point
`p0` - point to be transformed
• #### inverseTransformVec

```public void inverseTransformVec(Vector3d vr,
Vector3d v0)```
Applies an inverse transform to vector `v0` and places the result in `vr`.
Specified by:
`inverseTransformVec` in interface `VectorTransformer3d`
Parameters:
`vr` - returns the transformed vector
`v0` - vector to be transformed
• #### inverseTransformCovec

```public void inverseTransformCovec(Vector3d nr,
Vector3d n0)```
Applies an inverse transform to covector `c0` and places the result in `cr`. See `VectorTransformer3d.transformCovec(maspack.matrix.Vector3d, maspack.matrix.Vector3d)` for more details about covector transformation.
Specified by:
`inverseTransformCovec` in interface `VectorTransformer3d`
Parameters:
`nr` - returns the transformed normal
`n0` - normal to be transformed
• #### isAffine

`public boolean isAffine()`
Returns `true` if this transformer implements a linear affine transform.
Specified by:
`isAffine` in interface `VectorTransformer3d`
• #### isRigid

`public boolean isRigid()`
Returns `true` if this transformer implements a linear rigid transform.
Specified by:
`isRigid` in interface `VectorTransformer3d`
• #### scaleDistance

`public void scaleDistance(double s)`
Scale the distance units associated with this transformer. This is done by scaling both the scaling factors and the origin by `s`.
Parameters:
`s` - scaling factor
• #### copy

`public ScaledRigidTransformer3d copy()`
Creates and returns a copy of this transformer.
Specified by:
`copy` in interface `VectorTransformer3d`
Returns:
copy of this transformer
• #### toString

`public java.lang.String toString(java.lang.String fmtStr)`
Description copied from interface: `VectorTransformer3d`
Returns a string representation of this transformer.
Specified by:
`toString` in interface `VectorTransformer3d`
Parameters:
`fmtStr` - format string describing how floating point numbers should be formatted
Returns:
string representation of this transformer.