相关疑难解决方法(0)

C++:围绕某个点旋转矢量

我试图围绕向量上的某个点旋转向量(在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)

c++ vector rotation

15
推荐指数
2
解决办法
5万
查看次数

标签 统计

c++ ×1

rotation ×1

vector ×1