Using the Pythagorean theorem we can see that the distance is D = 7.62
How to find the distance from A to B?
Let's suppose that the distance from A to B is the hypotenuse of a right triangle.
Then if we have the coordinates:
A = (a₁, a₂)
B = (b₁, b₂)
Then the hypotenuse is:
H = √( (b₁ - a₁)² + (b₂ - a₂)² )
Here the points are:
A = (2, 1)
B = (5, 8)
Then the distance is:
D= √( (5 - 2)² + (8 - 1)² )
D = 7.62
That is the distance from A to B.