Skip to content
Justice Tech School

Norms and Distance

linalg.norm measures vector length. The distance between points is the norm of their difference.

Example
a = np.array([3.0, 4.0])
print(np.linalg.norm(a))
p = np.array([1, 1]); q = np.array([4, 5])
print(np.linalg.norm(p - q))

Result

5.0
5.0

Exercise

Vector length.

np.linalg.(a)

Quiz Test

What is the norm of [3, 4]?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.