CoursesAIMathCodePhysicsAbout and FAQ

TwiddleLab / Math / Vectors and Matrices

How Long Is an Arrow?

Lesson 2 of 12 · 7 min · Free, no account needed

What you will learn

  • The length of (x, y) comes from the squares on its legs: length² = x² + y².
  • So the length is √(x² + y²). For (3, 4) that is √25 = 5.
  • Distance between two points is the length of the arrow between them. AI uses it to find nearest neighbours.

Start the lesson

How the lesson goes

  1. A drone flies 3 km east, then 4 km north.

    How far is it from you, in a straight line? Drag the lever to your bet.

  2. Fly the drone to the beacon at (3, 4).

    Squares grow on the two legs of its arrow. A tilted one sits on the arrow itself.

  3. Pour the small squares into the tilted one.

    Do the 9 and the 16 cells fill it?

  4. That is how long an arrow is.

    The squares on the two legs add up to the square on the arrow: length² = x² + y².

    So the length of (x, y) is √(x² + y²). For (3, 4): √(9 + 16) = √25 = 5.

    This is the Pythagorean theorem, used on an arrow.

  5. Game: find six different arrows of length 5.

    Drag the head to a grid point and let go. Each find lights up.

  6. How long is the arrow (5, 12)?

    length² = 5² + 12² = 25 + 144 = 169, and √169 = 13.

  7. An AI sorts a new animal by its nearest neighbour.

    Each dot is an animal: ear length across, weight up. Tap the one closest to the ?.

    Distance is the length of the arrow between two points. (8, 3) - (5, 5) = (3, -2), length √13 ≈ 3.61, shorter than the 4 to the dog above.

  8. Make an arrow exactly 10 long that is not flat or straight up.

    Drag the head. The card adds the squares for you.

    Length 10 means x² + y² = 100. Doubling (3, 4) gives (6, 8): 36 + 64 = 100.

  9. Length is √(x² + y²): the straight-line shortcut.

    Race your arrow: one drone flies straight, the other along the legs.

Previous lesson: Arrows That Move Things · Next lesson: Adding Arrows · Part of the course: Vectors and Matrices

Lessons are interactive and need JavaScript. Turn it on to play them.

Loading TwiddleLab