给定一个旋转矩阵R,使某个点c(新的旋转中心)在变换 下不变y = R * c,即改变R使旋转中心位于c而不是原点的等效变换是什么。一个限制是我不能对要使用的实际矢量进行操作,只能编辑原始转换(这是因为那部分埋在外部库中,我无法更改它)。
我有一些有用的东西,但它违反了上述限制:
import numpy as np
# R is a given rotation matrix, v is an arbitrary vector and cen is the desired center
theta = np.pi / 2
cen = np.array([0.5, 0.5])
v = np.array([0, 0])
R = Rot(theta) # ordinary rotation matrix
y = R @ (v - center ) + cen
# y = [0, 1] which is the expected result since we have a right angle triangle
# with vertices at (0, 0) (0.5, 0.5) and (0, 1)
我也尝试实现类似于此处的计算,但我得到的结果不正确
我怎样才能获得相同的结果但保持形式y = R*v(或使用刚性 transform y = R*v + t)但v不像我那样改变?
凤凰求蛊
相关分类