MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / shearfactor

Method shearfactor

tools/python-3.11.9-amd64/Lib/turtle.py:2821–2842  ·  view source on GitHub ↗

Set or return the current shearfactor. Optional argument: shear -- number, tangent of the shear angle Shear the turtleshape according to the given shearfactor shear, which is the tangent of the shear angle. DO NOT change the turtle's heading (direction of move

(self, shear=None)

Source from the content-addressed store, hash-verified

2819 stretchfactor=stretchfactor, outline=outline)
2820
2821 def shearfactor(self, shear=None):
2822 """Set or return the current shearfactor.
2823
2824 Optional argument: shear -- number, tangent of the shear angle
2825
2826 Shear the turtleshape according to the given shearfactor shear,
2827 which is the tangent of the shear angle. DO NOT change the
2828 turtle's heading (direction of movement).
2829 If shear is not given: return the current shearfactor, i. e. the
2830 tangent of the shear angle, by which lines parallel to the
2831 heading of the turtle are sheared.
2832
2833 Examples (for a Turtle instance named turtle):
2834 >>> turtle.shape("circle")
2835 >>> turtle.shapesize(5,2)
2836 >>> turtle.shearfactor(0.5)
2837 >>> turtle.shearfactor()
2838 >>> 0.5
2839 """
2840 if shear is None:
2841 return self._shearfactor
2842 self.pen(resizemode="user", shearfactor=shear)
2843
2844 def settiltangle(self, angle):
2845 """Rotate the turtleshape to point in the specified direction

Callers

nothing calls this directly

Calls 1

penMethod · 0.80

Tested by

no test coverage detected