Applies a shear transform about the pivot (about_x, about_y): shx
displaces x-coordinates in proportion to y (distance from about_y),
shy displaces y-coordinates in proportion to x (distance from
about_x).
See also
Other transform helpers:
trans(),
trans_affine(),
trans_chain(),
trans_fn(),
trans_identity(),
trans_reflect(),
trans_rotate(),
trans_scale(),
trans_translate(),
trans_warp()
Examples
draw(shape_square(side = 1, trans = trans_shear(shx = 0.5)))
# overlay the original (faded) with the sheared copy (solid)
original <- shape_rectangle(
width = 1,
height = 0.6,
fill_alpha = 0.3,
color_alpha = 0.3
)
draw(sketch() + original + (original + trans_shear(shx = 0.6)))
# shy shears vertically instead of horizontally
draw(shape_square(side = 1, trans = trans_shear(shy = 0.5)))