Answers for "using np.linalg.norm to get vector norm of two vectors"

0

using np.linalg.norm to get vector norm of two vectors

A = np.array([2,3])

B = np.array([3,1])

print(f"A = {A}, B = {B}\n")
    
AB = B - A

print(f"vector AB = {AB}\n")
    
d_AB = np.linalg.norm(AB)

print(f"distance AB = {d_AB}")
Posted by: Guest on March-31-2021

Browse Popular Code Answers by Language