本文整理汇总了Python中Vector.Vector.component_orthogonal_to方法的典型用法代码示例。如果您正苦于以下问题:Python Vector.component_orthogonal_to方法的具体用法?Python Vector.component_orthogonal_to怎么用?Python Vector.component_orthogonal_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector.Vector
的用法示例。
在下文中一共展示了Vector.component_orthogonal_to方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: projecting_vectors
# 需要导入模块: from Vector import Vector [as 别名]
# 或者: from Vector.Vector import component_orthogonal_to [as 别名]
def projecting_vectors():
v = Vector(['3.039', '1.879'])
b = Vector(['0.825', '2.036'])
print("projection {0} onto {1} is {2}\n".format(v, b, v.component_parallel_to(b)))
v = Vector(['-9.88', '-3.264', '-8.159'])
b = Vector(['-2.155', '-9.353', '-9.473'])
print("component of {0} orthogonal to {1} is {2}\n".format(v, b, v.component_orthogonal_to(b)))
v = Vector(['3.009', '-6.172', '3.692', '-2.51'])
b = Vector(['6.404', '-9.144', '2.759', '8.718'])
print("{0} = {1} + {2}\n".format(v, v.component_parallel_to(b), v.component_orthogonal_to(b)))