Reference shearY()

shearY()

Shears the y-axis so that shapes appear skewed.

By default, the x- and y-axes are perpendicular. The shearY() function transforms the coordinate system so that y-coordinates are translated while x-coordinates are fixed.

The first parameter, angle, is the amount to shear. For example, calling shearY(1) transforms all y-coordinates using the formula y = y + x * tan(angle). shearY() interprets angle values using the current angleMode().

By default, transformations accumulate. For example, calling shearY(1) twice has the same effect as calling shearY(2) once. The push() and pop() functions can be used to isolate transformations within distinct drawing groups.

Note: Transformations are reset at the beginning of the draw loop. Calling shearY(1) inside the draw() function won't cause shapes to shear continuously.

Examples

Syntax

shearY(angle)

Parameters

angle

angle to shear by in the current angleMode().

Notice any errors or typos? Please let us know. Please feel free to edit src/core/transform.js and open a pull request!

Related References