标签:import urb scipy dom pre val 协方差矩阵 false list
Obvious,最小特征值对应的特征向量为平面的法向
Created on Sun Nov 05 19:37:26 2017 @author: Bambo """ import numpy as np import scipy x=[random.randint(0,100) for i in range(40)] y=[random.randint(0,100) for i in range(40)] z=[a*3+b*2+1 for a,b in zip(x,y)] r=map(list,zip(x,y,z)) k=mat(r) re=k.T*k e,v=scipy.linalg.eigh(re,turbo=False,eigvals=(0,0)) #e,v=scipy.linalg.eigh(re,eigvals=(a,b)) print e print v
python计算平面的法向-利用协方差矩阵求解特征值和特征向量
标签:import urb scipy dom pre val 协方差矩阵 false list
原文地址:http://www.cnblogs.com/BambooEatPanda/p/7797660.html