To find the 2-norm of a vector in Python using numpy, you can use the numpy.linalg.norm()
function. The second argument of the function specifies the type of norm, which in this case is 2
for the 2-norm.
main.py154 chars10 lines
To check the orthogonality of two vectors in Python using numpy, you can use the numpy.dot()
function to compute the dot product of the vectors. If the dot product is zero, then the vectors are orthogonal.
main.py283 chars14 lines
gistlibby LogSnag