角度和旋转Angles and Rotation
2.1 角度描述方向2.1 Angles Describe Direction
坐标告诉我们机器人"在哪",角度告诉我们机器人"朝哪"。Coordinates tell us "where" the robot is; angles tell us "which direction" it's facing.
我们用角度来描述方向:We use angles to describe direction:
- 0 度 = 面朝前(y 正方向)0 degrees = facing forward (positive y direction)
- 90 度 = 面朝右90 degrees = facing right
- 180 度 = 面朝后180 degrees = facing backward
- 270 度 = 面朝左270 degrees = facing left
2.2 顺时针还是逆时针?2.2 Clockwise or Counterclockwise?
我们约定:顺时针 = 正角度。Our convention: clockwise = positive angle.
跟时钟一样:从 12 点(前方)往 3 点(右边)转,就是顺时针转了 90 度。Just like a clock: turning from 12 o'clock (front) to 3 o'clock (right) is a 90-degree clockwise turn.
数学课上一般逆时针为正。我们这里用顺时针为正,因为从上方俯视机器人时,顺时针更直觉 -- 就跟看时钟一样。In math class, counterclockwise is usually positive. We use clockwise as positive here because when looking down at the robot from above, clockwise feels more natural — just like reading a clock.
你面朝前(0 度),顺时针转 180 度,现在面朝哪?You're facing forward (0 degrees). You turn 180 degrees clockwise. Which direction are you facing now?
2.3 角度和移动方向2.3 Angles and Movement Direction
当机器人朝某个角度走直线时,x 和 y 坐标都可能变化:When the robot moves in a straight line at a certain angle, both x and y coordinates may change:
- 朝 0 度走 -- 只有 y 变(往前走)Moving at 0 degrees — only y changes (moving forward)
- 朝 90 度走 -- 只有 x 变(往右走)Moving at 90 degrees — only x changes (moving right)
- 朝 45 度走 -- x 和 y 都变,而且变化量一样大Moving at 45 degrees — both x and y change by the same amount
那如果朝 30 度走呢?x 和 y 各变多少?这就是下一章要解决的问题。What if you move at 30 degrees? How much do x and y each change? That's what the next chapter is about.