coords.py 文件源码

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

项目:seismic-python 作者: malcolmw 项目源码 文件源码
def rotation_matrix(alpha, beta, gamma):
    """
    Return the rotation matrix used to rotate a set of cartesian
    coordinates by alpha radians about the z-axis, then beta radians
    about the y'-axis and then gamma radians about the z''-axis.
    """
    ALPHA = np.array([[np.cos(alpha), -np.sin(alpha), 0],
                        [np.sin(alpha), np.cos(alpha), 0],
                        [0, 0, 1]])
    BETA = np.array([[np.cos(beta), 0, np.sin(beta)],
                        [0, 1, 0],
                        [-np.sin(beta), 0, np.cos(beta)]])
    GAMMA = np.array([[np.cos(gamma), -np.sin(gamma), 0],
                        [np.sin(gamma), np.cos(gamma), 0],
                        [0, 0, 1]])
    R = ALPHA.dot(BETA).dot(GAMMA)
    return(R)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号