def toaxisangle(q): tw = math.acos(q[3]) scale = math.sin(tw) angle = tw * 2.0 try: axis = vec3.divN(q[:3], scale) except ZeroDivisionError: axis = (1.0, 0.0, 0.0) return axis, angle
def toaxisangle(q): tw= math.acos(q[3]) scale= math.sin(tw) angle= tw*2.0 try: axis= vec3.divN(q[:3], scale) except ZeroDivisionError: axis= (1.0,0.0,0.0) return axis,angle
def tovec3(a): return vec3.divN(a, a[3])