本文整理汇总了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