In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you the relevant knowledge of how python uses the circle function to draw rabbits. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
Circle function description
1. In the circle function, the parameter radius takes the pixel value and the extent takes the angle integer value can take the positive and negative value.
The circle () function takes the current direction of the brush (y') as the y-axis direction, through the current absolute coordinates of the brush (x0, assuming y _ 0), and the direction perpendicular to the y-axis is the x-axis direction, then the center (that is, the origin) coordinate is (x _ 0 color radiuso _ 0), and the arc of the extent angle is drawn from the current position of the brush (x _ 0).
2. The circle () function can take the current position of the brush as the tangent point and draw any arc tangent to the tangent (the straight line in the current direction of the brush). Therefore, drawing curves is very free and easy to use.
Example
# draw the big-eared rabbit from turtle import * speed (10) # the rabbit's face color ('pink') pensize (5) circle (radius=100) # face # eye pencolor (' black') # left eye pu () goto (- 45pr 92) pd () begin_fill () color ) circle (radius=15) # right eye pu () goto (45Pol 92) pd () circle (radius=15) end_fill () # nose pu () goto (20L60) color ('pink') pd () begin_fill () goto (- 20pd 60) goto (0Power45) goto (20Power60) end_fill () # mouth goto (0Magazine 45) goto (0Magne40) seth (- 90) circle (10120) pu () goto (0Med 40) seth (- 90) pd () circle (- 10120) # Rabbit ear Duo # pu () goto (- 60180) # seth (200) pd () circle (radius=350 Extent=90) goto (- 98110) # right ear pu () goto (60180) # seth (- 20) pd () circle (radius=-350,extent=90) goto (98110) # Rabbit body pu () goto (- 25) seth (- 25) pd () circle (radius=-250,extent=25) circle (radius=-135,extent=260) seth (50) circle (radius=-250,extent=25) # # Rabbit arm # left arm pu () seth (180) goto (- 30) pd () # short arm # circle (radius=270 Extent=20) # # circle (radius=20,extent=190) circle (radius=248,extent=30) circle (radius=29,extent=185) # right arm pu () seth (0) goto (30) pd () circle (radius=-248,extent=30) circle (radius=-27,extent=184) # # Rabbit's foot # # left foot pu () goto (- 162) circle (radius=41) # right foot pu () goto Pd () circle (radius=41) done () these are all the contents of the article "how to draw rabbits with circle functions by python" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.