import numpy as np
def rotation(x, t, deg = False):
if deg == True:
t = np.deg2rad(t)
a = np.array([[np.cos(t), -np.sin(t)],
[np.sin(t), np.cos(t)]])
ax = np.dot(a, x)
return ax
P = [1, 0]
t = 45
rotation(P, t, deg=True)
array([0.70710678, 0.70710678])
P = [0, 1]
t = 30
rotation(P, t, deg=True)
array([-0.5 , 0.8660254])