In physics, motion that takes place in the real world is often in two dimensions. As a result, you need to find both the distance and direction traveled to tell the whole story.
If you want to examine motion in two dimensions, you need two intersecting meter sticks (or number lines), called axes. You have a horizontal axis (the x-axis) and a vertical axis (the y-axis).

Take a look at this figure, where a golf ball moves around in two dimensions. The ball starts at the center of the graph and moves up to the right. In terms of the axes, the golf ball moves to +4 meters on the x-axis and +3 meters on the y-axis, which is represented as the point (4, 3); the x measurement comes first, followed by the y measurement: (x, y).
So what does this mean in terms of displacement? The change in the x position,

is equal to the final x position minus the initial x position. If the golf ball starts at the center of the graph — the origin of the graph, location (0, 0) — you have a change in the x location of

The change in the y location is

If you’re more interested in figuring out the magnitude (size) of the displacement than in the changes in the x and y locations of the golf ball, that’s a different story. The question now becomes: How far is the golf ball from its starting point at the center of the graph?
Using the distance formula — which is just the Pythagorean theorem solved for the hypotenuse — you can find the magnitude of the displacement of the golf ball, which is the distance it travels from start to finish. The Pythagorean theorem states that the sum of the squares of the legs of a right triangle (a2 + b2) is equal to the square on the hypotenuse (c2). Here, the legs of the triangle are

and the hypotenuse is s. Here’s how to work the equation:

So in this case, the magnitude of the ball’s displacement is exactly 5 meters.
You can find the direction of an object’s movement from the values of

Because these are just the legs of a right triangle, you can use basic trigonometry to find the angle of the ball’s displacement from the x-axis. The tangent of this angle is simply given by

Therefore, the angle itself is just the inverse tangent of that:

The ball in the figure has moved at an angle of 37° from the x-axis.