Skip to content
The Chat Archive
gpt-3.5-turbo-0301· OpenAI WildChat-4.8M (AI2)

Untitled conversation

  1. User

    [0,0,-1] 绕 [1,0,0]旋转30度 等于多少

  2. Assistant

    将向量[0,0,-1]绕[1,0,0]旋转30度,可以使用旋转矩阵计算。

    首先,将旋转轴[1,0,0]单位化,得到:

    u=[1,0,0]12+02+02=[1,0,0]\textbf{u}=\frac{[1,0,0]}{\sqrt{1^2+0^2+0^2}}=[1,0,0]

    其次,计算旋转矩阵:

    R=cos30∘I+(1−cos30∘)uuT+sin30∘S=[1000cos30∘−sin30∘0sin30∘cos30∘]\begin{aligned} \textbf{R}&=\text{cos}30^\circ \textbf{I}+(1-\text{cos}30^\circ)\textbf{uu}^T+\text{sin}30^\circ\textbf{S} \\ &=\begin{bmatrix} 1 & 0 & 0 \\ 0 & \text{cos}30^\circ & -\text{sin}30^\circ \\ 0 & \text{sin}30^\circ & \text{cos}30^\circ \end{bmatrix} \end{aligned}

    其中,I\textbf{I}为3x3的单位矩阵,uuT\textbf{uu}^T为3x3的矩阵,其对角线上元素为1,其他元素为0,除对角线外,第1行1列、第1列1行的元素为1,表示u\textbf{u}与其转置的乘积;S\textbf{S}为反对称矩阵,即:

    S=[0−uzuyuz0−ux−uyux0]\textbf{S}=\begin{bmatrix} 0 & -u_z & u_y \\ u_z & 0 & -u_x \\ -u_y & u_x & 0 \end{bmatrix}

    带入参数,得到:

    R=[100032−1201232]\textbf{R}=\begin{bmatrix} 1 & 0 & 0 \\ 0 & \frac{\sqrt{3}}{2} & -\frac{1}{2} \\ 0 & \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix}

    将旋转矩阵作用于向量[0,0,-1],得到旋转后的向量:

    [100032−1201232][00−1]=[0−32−12]\begin{bmatrix} 1 & 0 & 0 \\ 0 & \frac{\sqrt{3}}{2} & -\frac{1}{2} \\ 0 & \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} 0 \\ 0 \\ -1 \end{bmatrix} = \begin{bmatrix} 0 \\ \frac{-\sqrt{3}}{2} \\ -\frac{1}{2} \end{bmatrix}

    因此,[0,0,-1]绕[1,0,0]旋转30度后得到的向量为[0, -32 {\sqrt{3}}\over{2}, -12{1}\over{2}]。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.