I have here some mine procs for such conversions and other math operations with eulers (no possible otherwise):
def Eu_degr(eu): # eu in radians
eu_x,eu_y,eu_z = eu[0],eu[1],eu[2]
eu_x = math.degrees(eu_x)
eu_y = math.degrees(eu_y)
eu_z = math.degrees(eu_z)
eu_degr = Mathutils.Euler(eu_x,eu_y,eu_z)
return eu_degr
def Eu_rad(eu): # eu in degrees
eu_x,eu_y,eu_z = eu[0],eu[1],eu[2]
eu_x = math.radians(eu_x)
eu_y = math.radians(eu_y)
eu_z = math.radians(eu_z)
eu_rad = Mathutils.Euler(eu_x,eu_y,eu_z)
return eu_rad
def Eu_add(eu1,eu2): # eu1,eu2 in degrees
eu_x1,eu_y1,eu_z1 = eu1[0],eu1[1],eu1[2]
eu_x2,eu_y2,eu_z2 = eu2[0],eu2[1],eu2[2]
eu_new = Mathutils.Euler(eu_x1+eu_x2,eu_y1+eu_y2,eu_z1+eu_z2)
return eu_new
def Eu_sub(eu1,eu2): # eu1,eu2 in degrees
eu_x1,eu_y1,eu_z1 = eu1[0],eu1[1],eu1[2]
eu_x2,eu_y2,eu_z2 = eu2[0],eu2[1],eu2[2]
eu_new = Mathutils.Euler(eu_x1-eu_x2,eu_y1-eu_y2,eu_z1-eu_z2)
return eu_new
def Eu_mult(eu1,c): # eu1 in degrees; c - constant
eu_x1,eu_y1,eu_z1 = eu1[0],eu1[1],eu1[2]
c *= 1.0 # make it a real value for sure
eu_new = Mathutils.Euler(eu_x1*c,eu_y1*c,eu_z1*c)
return eu_new
def Eu_div(eu1,c): # eu1 in degrees; c - constant
eu_x1,eu_y1,eu_z1 = eu1[0],eu1[1],eu1[2]
c *= 1.0 # make it a real value for sure
eu_new = Mathutils.Euler(eu_x1/c,eu_y1/c,eu_z1/c)
return eu_new
ALL tested and working mathematically correct
Regards,