Como girar o vetor 2D por diploma em Python:

from math import cos, sin

import numpy as np

theta = np.deg2rad(30)

rot = np.array([[cos(theta), -sin(theta)], [sin(theta), cos(theta)]])

v = np.array([1, 0])
w = np.array([3, 4])

v2 = np.dot(rot, v)
w2 = np.dot(rot, w)

print(v2)  # [0.8660254 0.5      ]
print(w2)  # [0.59807621 4.96410162]
Plain Parrot