-This script attached to a sensor rotates an object 10 degrees(angle=10)

in y-axis

```
import GameLogic
from math import *
cont=GameLogic.getCurrentController()
own=cont.getOwner()
######## Matrix2Euler ########
mat = own.getOrientation()
size = [1,1,1]
def mat2euler(mat, size):
scale = [0.0, 0.0, 0.0]
if size[0]!=0.0:
scale[0] = 1.0/size[0]
if size[1]!=0.0:
scale[1] = 1.0/size[1]
if size[2]!=0.0:
scale[2] = 1.0/size[2]
angle_y = -asin(mat[0][2] * scale[0])
C = cos(angle_y)
if abs(angle_y)>1.0e-10:
C = 1.0/C
angle_x = atan2((mat[1][2] * scale[1]) * C, (mat[2][2] * scale[2]) * C)
angle_z = atan2((mat[0][1] * scale[0]) * C, (mat[0][0] * scale[0]) * C)
else:
angle_x = 0.0
angle_z = -atan2((mat[1][0] * scale[1]), (mat[1][1] * scale[1]))
return (angle_x, angle_y, angle_z)
######## Euler2Matrix ########
def euler2mat(rot_x,rot_y,rot_z):
A = cos(rot_x)
B = sin(rot_x)
C = cos(rot_y)
D = sin(rot_y)
E = sin(rot_z)
F = cos(rot_z)
AD = A * D
BD = B * D
ori = [[C*E,-C*F,-D],[-BD*E+A*F,BD*F+A*E,-B*C],[AD*E+B*F,-AD*F+B*E,A*C]]
return (ori)
rot = mat2euler(mat,size)
rot_x = rot[0]
rot_y = rot[1]
rot_z = rot[2]
######## Get Sensors ########
sensorlist = cont.getSensors()
s0 = sensorlist[0]
######## Are the keys pressed ########
if s0.isPositive():s0 = 1
######## Functions ########
#rotated by 10 degrees
angle = 10
if s0 == 1:
rot_y = rot_y + angle * pi / 180
ori = euler2mat(rot_x,rot_y,rot_z)
own.setOrientation(ori)
```

Ben