Turtle Conic Curve Series - Parabola


Environmental preparation

Running platform. Windows 7 Signature Edition

python Version.python 3.6.4

IDE: Python comes with IDLE

1、Drawing principle

If the equation of the parabola is: , and the point P is on the parabola, then the equation of the tangent to the parabola through the point P is.

2. Drawing a parabola

importturtleast

t.pencolor("red")

t.speed(1)

a=1

forxinrange(30):

a+=0.2

t.left(2)

t.forward(a)

t.penup()# no drawing when moving

t.goto(0,0)# return to the origin

t.pendown()# by default also draws the graph

t.left(120)# because the previous has been cumulatively rotated by 60 degrees

b=1

forxinrange(30):

b+=0.2

t.right(2)

t.forward(b)

t.mainloop()

Results of the run.

——The End ——


Recommended>>
1、Tencent and Shenzhen to build housing rental platform
2、Mobay APP part of the function of a short period of time failure the relevant staff response due to network problems is investigating the repair check
3、Big data analysis platform for public resource transactions helping the National Information Center to cover the whole country with one network
4、FDA releases 2019 strategic framework Realworld data to be incorporated into regulatory decisions
5、Perhaps it is easier to understand https

    已推荐到看一看 和朋友分享想法
    最多200字,当前共 发送

    已发送

    朋友将在看一看看到

    确定
    分享你的想法...
    取消

    分享想法到看一看

    确定
    最多200字,当前共

    发送中

    网络异常,请稍后重试

    微信扫一扫
    关注该公众号