planet.py 文件源码

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

项目:SolarSystem 作者: elbanic 项目源码 文件源码
def calc_coord(self, transCoord, p, d, a, e, i, w):
        # cx, cy, cz ?? ??
        # p, ?? d, ?? ??
        # a ??, e ???
        # i ?? ???
        unitAng = 360/p
        ang = (unitAng * d) % 360
        theta = np.deg2rad(ang)
        b = a * np.sqrt(1 - np.power(e, 2))
        x = transCoord[0] + a * np.cos(theta)
        y = transCoord[1] + b * np.sin(theta)
        z = 0.0

        #rotate
        w = np.deg2rad(w)
        x1, y1 = x, y
        #x = transCoord[0] + (x1 * np.cos(w) - y1 * np.sin(w))
        #y = transCoord[1] + (x1 * np.sin(w) + y1 * np.cos(w))

        coord = [x, y, z]
        return coord
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号