1.python shell中执行
>>>turtle.pos()
(10.00, 10.00)
>>> turtle.towards(0,0)
225.0
官方文档内容:
Return the angle, between the line from turtle-position to position
specified by x, y and the turtle's start orientation. (Depends on
modes - "standard" or "logo")
根据我的理解应该是45度,为什么是225那?
文档就不解释了,中文传送门
计算角度主要还是要看模式吧,不管是
"标准"<向右,东,逆时针>
,还是"logo"<向上,北,顺时针>
,开始位置(10,10)朝向东,逆时针旋转朝向(0,0)这个位置的角度,结果225
开始位置(10,10)朝向北,顺时针旋转朝向(0,0)这个位置的角度,结果225