python 绘制sinx

 

 code

import turtle
import math

turtle.speed(0)
turtle.penup()
turtle.goto(-175, 50 * math.sin((-175/100) * 2 * math.pi))
turtle.pendown()
turtle.color("red")
for x in range(-175, 176):

    turtle.goto(x, 50 * math.sin((x/100) * 2 * math.pi))

turtle.color("black")
turtle.penup()
turtle.goto(-100, -15)
turtle.write("-2\u03c0", font=("黑体", 15))
turtle.pendown()

turtle.penup()
turtle.goto(100, 15)
turtle.write("2\u03c0", font=("黑体", 15))
turtle.pendown()

turtle.penup()
turtle.goto(-160, 0)
turtle.pendown()
turtle.goto(160, 0)
turtle.write("x", font=("宋体",15))
turtle.goto(150, 10)
turtle.goto(160, 0)
turtle.goto(150, -10)

turtle.penup()
turtle.goto(0, -160)
turtle.pendown()
turtle.goto(0, 160)
turtle.write("y", font=("宋体",15))
turtle.goto(-10, 150)
turtle.goto(0, 160)
turtle.goto(10, 150)
turtle.done()

 

python 绘制sinx

 

上一篇:数学笔记24——分部积分


下一篇:SQL Server事务遭遇网络异常时的处理机制浅析