archipack_2d.py 文件源码

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

项目:archipack 作者: s-leger 项目源码 文件源码
def scale_rot_matrix(self, u, v):
        """
            given vector u and v (from and to p0 p1)
            apply scale factor to radius and
            return a matrix to rotate and scale
            the center around u origin so
            arc fit v
        """
        # signed angle old new vectors (rotation)
        a = self.signed_angle(u, v)
        # scale factor
        scale = v.length / u.length
        ca = scale * cos(a)
        sa = scale * sin(a)
        return scale, Matrix([
            [ca, -sa],
            [sa, ca]
            ])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号