Exemplo n.º 1
0
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
Exemplo n.º 2
0
Arquivo: quat.py Projeto: Eelis/klee
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
Exemplo n.º 3
0
def tovec3(a):
	return vec3.divN(a, a[3])
Exemplo n.º 4
0
def tovec3(a):
	return vec3.divN(a, a[3])