Answers for "create vector with norm 1 numpy"

2

norm complex numpy

#c is a complex number
np.linalg.norm(c)

#or
np.absolute(c)
Posted by: Guest on September-06-2020
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

Python Answers by Framework

Browse Popular Code Answers by Language