我试图围绕向量上的某个点旋转向量(在C++中):
1 2 3
4 5 6
7 8 9
Run Code Online (Sandbox Code Playgroud)
围绕点(1,1)(即"5")旋转90度会导致:
7 4 1
8 5 2
9 6 3
Run Code Online (Sandbox Code Playgroud)
现在我正在使用:
x = (x * cos(90)) - (y * sin(90))
y = (y * cos(90)) + (x * sin(90))
Run Code Online (Sandbox Code Playgroud)
但我不想让它旋转(0,0)