public class Shear extends Transformation
|Constructor and Description|
Create a shear transformation given a name and the shear factor
|Modifier and Type||Method and Description|
Apply the shear to a point to produce a new point leaving the original point unchanged.
Get a string representation of the shear.
Transform a point changing its coordinates.
public Shear(String name, double h)
name- the name of the transformation
h- the shear factor
public void transform(Point2D p)
ycoordinates of the point are transformed as follows:
x = x + h * y
y = y (i.e., the y coordinate is unchanged)
public String toString()
" : shear of factor "followed by the shear factor. For example, a shear of factor
T1has the following string representation:
"T1 : shear of factor 1.876435632"