turtle.shapetransform() function in Python
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
This function is used to set or return the current transformation matrix of the turtle shape. If none of the matrix elements are given, it returns the transformation matrix. Otherwise, set the given elements and transform the turtleshape according to the matrix consisting of first row t11, t12, and second-row t21, 22.
Syntax : turtle.shapetransform(t11=None, t12=None, t21=None, t22=None)
t11, t12, t21, t22 (optional): The determinant t11 * t22 – t12 * t21 must not be zero, otherwise an error is raised.
Below is the implementation of the above method with some examples :
Example 1 :
(1.0, 0.0, 0.0, 1.0)
Example 2 :
turtle.TurtleGraphicsError: Bad shape transform matrix: must not be singular
Example 3 :
Please Login to comment...