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]
])
评论列表
文章目录