給定一個旋轉矩陣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 centertheta = np.pi / 2cen = np.array([0.5, 0.5])v = np.array([0, 0])R = Rot(theta) # ordinary rotation matrixy = 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不像我那樣改變?
1 回答

鳳凰求蠱
TA貢獻1825條經驗 獲得超4個贊
在寫這個問題時,我想到了(顯而易見的)解決方案,它只是擴展我之前寫的解決方案并重新排列。如果有人也需要這個,新的轉換應該是:
y = R_new*v + t_new
其中R_new = R
,t_new = (I - R)*cen
和I
是恒等式。
添加回答
舉報
0/150
提交
取消