本文整理匯總了Python中Quaternion.identity方法的典型用法代碼示例。如果您正苦於以下問題:Python Quaternion.identity方法的具體用法?Python Quaternion.identity怎麽用?Python Quaternion.identity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Quaternion
的用法示例。
在下文中一共展示了Quaternion.identity方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Quaternion
# 需要導入模塊: import Quaternion [as 別名]
# 或者: from Quaternion import identity [as 別名]
q = Quaternion(a = 1000.0002, b = 2.03, c = 0.04, d = 40004.5)
print "q = %s" % q
print "magnitude: abs(q) = %s" % q.magnitude()
q.normalize()
print "normalized q = %s" % q
print "magnitude: abs(q) = %s" % q.magnitude()
print "### Quaternion - Conjugate"
q.uniform(rng)
print "q = %s" % q
q.conjugate()
print "q.conjugate() = %s" % q
print "### Quaternion - Identity"
q.identity()
print "q.identity = %s" % q
print "q.magnitude = %s" % q.magnitude()
print "### Quaternion - Convert Quaternion to Angle-Axis"
q = Quaternion(a = 0.707, b = -0.240, c = -0.665, d = 0.000)
print q
print "Angle = %s, %s" % q.get_angle_axis()
print "### Quaternion - Convert Angle-Axis to Quaternion"
q.identity()
angle = 1.57
axis = Axis3(x = -0.340, y = -0.940, z = 0.000)
print "Angle = %s, %s" % (angle, axis)
q.set_angle_axis(angle, axis)
print q