Commit 599f0494 authored by Richard Benson's avatar Richard Benson

dflkj

parent 88470e5c
......@@ -3,7 +3,7 @@ import numpy as np
def similar (v1, v2):
ε = 0.000001
# is this accurate? seems reasonable
# is this accurate enough? seems reasonable
if np.linalg.norm(v1 - v2) < ε:
return True;
#if abs(v1[0] - v2[0]) < ε and \
......@@ -17,14 +17,14 @@ A = np.array([[3, 6, 7],
[3, 3, 7],
[5, 6, 5]])
# is this vector an eigenvector of A
# vector to test whether an eigenvector of A
b = np.array([[ 1],
[-2],
[ 1]])
# get normalized eigenvalues and eigenvectors of A
λ, v = np.linalg.eig(A)
# create vc from v's columns
# create vc from v's columns because v is ordered column-wise
vc = [v[:,i] for i in range(3)]
# make b a vector
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment