GUI.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:CP244 作者: Unathi-Skosana 项目源码 文件源码
def plot_ellipses(self):
        q = 0.60
        r = ops.get_ellipse_rad(q)
        H = ops.get_hessian(self.X)
        eigv, rotation  = la.eigh(H)
        center = self.Bh

        u = np.linspace(0.0, 2.0 * np.pi, 100)
        v = np.linspace(0.0, np.pi, 100)

        x = (r/math.sqrt(eigv[0]))* np.outer(np.cos(u), np.sin(v))
        y = (r/math.sqrt(eigv[1])) * np.outer(np.sin(u), np.sin(v))
        z = (r/math.sqrt(eigv[2])) * np.outer(np.ones_like(u), np.cos(v))

        for i in range(len(x)):
            for j in range(len(x)):
                [x[i,j],y[i,j],z[i,j]] = np.dot([x[i,j],y[i,j],z[i,j]], rotation) + center

        plt.plot(z,x)
        plt.axis('equal')
        plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号