turtle.shapetransform() function in Python Last Updated : 01 Aug, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. turtle.shapetransform() 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) Parameters: 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 : Python3 # import package import turtle # check the default value print(turtle.shapetransform()) Output : (1.0, 0.0, 0.0, 1.0) Example 2 : Python3 # import package import turtle # change shapetransform to 2,0,2,0 # as determinant of the matrix # [[2,0],[0,2]] is 0. # so, raised an error turtle.shapetransform(2,0,2,0) Output : turtle.TurtleGraphicsError: Bad shape transform matrix: must not be singular Example 3 : Python3 # import package import turtle # loop for pattern for i in range(5): for j in range(10): # motion turtle.forward(5+5*(i+j)) turtle.left(45) # transform the shape turtle.shapetransform(i+1,0,0,i+1) Output : Comment More infoAdvertise with us Next Article turtle.sety() function in Python D deepanshu_rustagi Follow Improve Article Tags : Python Python-turtle Practice Tags : python Similar Reads turtle.shape() function in Python The turtle module in Python simplifies graphical programming, making it ideal for beginners. It supports both object-oriented and procedural approaches and relies on Tkinter as its graphical engine. One of its key functions, turtle.shape() allows users to set or retrieve the shape of the turtle curs 3 min read turtle.shearfactor() 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. turtle.shearfactor() This function is used to set or return the current shearfactor 1 min read turtle.stamp() 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. turtle.stamp() This method is used to stamp a copy of the turtleshape onto the canv 1 min read turtle.sety() 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. turtle.sety() This method is used to set the turtle's second coordinate to y, leavi 1 min read turtle.seth() 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. turtle.seth() This method is used to set the orientation of the turtle to to_angle. 2 min read turtle.setx() 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. turtle.setx() This method is used to set the turtle's first coordinate to x, leave 1 min read Like