Skip to content

Commit

Permalink
GEOMETRY-117 - AffineTransformMatrix2D should support shear transform
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Läubrich committed Mar 24, 2021
1 parent 8c82ce9 commit 192830f
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,20 @@ public AffineTransformMatrix2D translate(final double x, final double y) {
);
}

/**
* Apply a shear to the current instance, returning the result as a new transform.
* @param shx shear in x-direction
* @param shy shear in y direction
* @return a new transform containing the result of applying a shear to
* the current instance
*/
public AffineTransformMatrix2D shear(double shx, double shy) {
return multiply(AffineTransformMatrix2D.of(
1.0, shx, 0.0,
shy, 1.0, 0.0
), this);
}

/** Apply a scale operation to the current instance, returning the result as a new transform.
* @param factor the scale factor to apply to all axes
* @return a new transform containing the result of applying a scale operation to
Expand Down

0 comments on commit 192830f

Please sign in to comment.