0 / 4 页已完成

坐标系 — 告诉别人"你在哪"Coordinate System — Describing "Where You Are"

1.1 为什么需要坐标?1.1 Why Do We Need Coordinates?

VEX 比赛的场地是一个 366cm x 366cm 的正方形。比赛中你要跟队友沟通机器人的位置。The VEX competition field is a 366cm x 366cm square. During a match, you need to communicate your robot's position to your teammates.

如果你说"机器人在左边一点",队友会问:多左?多一点是多少?If you say "the robot is a bit to the left," your teammate will ask: how far left? How much is "a bit"?

所以我们需要一种精确的方式来描述位置 -- 用两个数字:一个表示左右,一个表示前后。这就是坐标That's why we need a precise way to describe position — using two numbers: one for left-right, one for front-back. This is what coordinates are.

坐标就是两个数字Coordinates Are Just Two Numbers

写法是 (x, y)。x 表示左右位置,y 表示前后位置。比如 (100, 200) 的意思是"往右 100cm、往前 200cm"。Written as (x, y). x represents the left-right position, y represents the front-back position. For example, (100, 200) means "100cm to the right, 200cm forward."

1.2 x 和 y1.2 x and y

看下面这个简化的场地俯视图,上面标了几个位置的坐标:Look at this simplified top-down view of the field, with coordinates marked at several positions:

x+ y+ (0, 0) (100, 100) (-100, -100) (100, -100) VEX 场地俯视图(简化)

几个要点:Key points:

动手试试Try It Yourself

在脑子里想象一个方格纸。你站在 (0, 0):Imagine a grid in your head. You're standing at (0, 0):

1.3 原点和正方向1.3 Origin and Positive Directions

原点就是坐标的起始点 (0, 0)。通常我们把机器人出发的位置设为原点。The origin is the starting point of the coordinate system, (0, 0). We usually set the robot's starting position as the origin.

正方向的约定:The positive direction convention:

这个约定并不是绝对的 -- 有些代码可能把 y 正方向定义成往后。重要的是:你和你的代码约定一致就行。This convention isn't absolute — some code might define positive y as backward. What matters is: you and your code agree on the same convention.

记住Remember

坐标系没有"标准答案",关键是团队和代码保持一致。我们这里统一用:右 = x 正、前 = y 正。There's no "correct answer" for coordinate systems — the key is consistency within your team and code. We'll use: right = positive x, forward = positive y.

检查点Checkpoint
机器人在 (10, 20),往前走了 5cm,现在在哪?The robot is at (10, 20) and moves forward 5cm. Where is it now?