geom.py 文件源码

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

项目:sc8pr 作者: dmaccarthy 项目源码 文件源码
def _matrix(rotate=0, scale=1, rev=False):
    "Create a 2x2 matrix (as a 4-tuple) to perform a scale transformation and a rotation"
    sx, sy = (scale, scale) if type(scale) in (float, int) else scale
    if rotate:
        rotate *= DEG
        c, s = cos(rotate), sin(rotate)
    else: c, s = 1, 0
    if rev: # Rotate before scaling
        return sx * c, -sx * s, sy * s, sy * c
    else:   # Scale before rotating
        return sx * c, -sy * s, sx * s, sy * c
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号