i was making a program to display matrices under various transforms, and all of them work except for my rotation matrix. ive tried fiddling with it, but nothing seems to work
y = input("how many degrees do you want to rotate the shape around the origin?: ")
j = array([(cos(int(y)), -sin(int(y))), (sin(int(y)), cos(int(y)))])
print(j.dot(w))
input("enter to exit")
As the python documentation for
cosandsinpoint out, the arguments should be in radians, not degrees.You can use the
math.radiansfunction to convert degrees to radians.