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 cos
and sin
point out, the arguments should be in radians, not degrees.
You can use the math.radians
function to convert degrees to radians.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With