MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / shearfactor

Method shearfactor

Python/Turtle.py:2719–2740  ·  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 movement).

(self, shear=None)

Source from the content-addressed store, hash-verified

2717 stretchfactor=stretchfactor, outline=outline)
2718
2719 def shearfactor(self, shear=None):
2720 """Set or return the current shearfactor.
2721
2722 Optional argument: shear -- number, tangent of the shear angle
2723
2724 Shear the turtleshape according to the given shearfactor shear,
2725 which is the tangent of the shear angle. DO NOT change the
2726 turtle's heading (direction of movement).
2727 If shear is not given: return the current shearfactor, i. e. the
2728 tangent of the shear angle, by which lines parallel to the
2729 heading of the turtle are sheared.
2730
2731 Examples (for a Turtle instance named turtle):
2732 >>> turtle.shape("circle")
2733 >>> turtle.shapesize(5,2)
2734 >>> turtle.shearfactor(0.5)
2735 >>> turtle.shearfactor()
2736 >>> 0.5
2737 """
2738 if shear is None:
2739 return self._shearfactor
2740 self.pen(resizemode="user", shearfactor=shear)
2741
2742 def settiltangle(self, angle):
2743 """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