Loading

PshearY


processing
Since v1.0.0
Available on all platforms
See also

Shears a shape around the y-axis the amount specified by the angle parameter. Angles should be specified in radians (values from 0 to 2 PI). Objects are always sheared around their relative position to the origin and positive numbers shear objects in a clockwise direction. Transformations apply to everything that happens after and subsequent calls to the function accumulates the effect.

Technically, PshearY multiplies the current transformation matrix by a rotation matrix. This function can be further controlled by the PpushMatrix and PpopMatrix functions.

Link to original Processing doc

Signature

Examples

// @preview image <% //draw smiley macro 'centerY' STORE 'centerX' STORE 'CENTER' PellipseMode $centerX $centerY 30 30 Pellipse 0 Pfill $centerX 7 - $centerY 5 - 5 8 Pellipse $centerX 7 + $centerY 5 - 5 8 Pellipse PnoFill $centerX $centerY 22 22 0.5 1.5 Parc %> 'drawsmiley' STORE 200 200 '2D3' PGraphics 255 Pbackground 0 0 @drawsmiley //top left corner 100 100 Ptranslate pi 6 / PshearY 0 0 @drawsmiley 40 0 @drawsmiley 0 30 Ptranslate //try to invert this line with the next one pi -6 / PshearX 0 0 @drawsmiley 40 0 @drawsmiley PresetMatrix 200 200 @drawsmiley //bottom right corner Pencode