本文整理汇总了Python中Vector.Vector.area_of_triangle_with方法的典型用法代码示例。如果您正苦于以下问题:Python Vector.area_of_triangle_with方法的具体用法?Python Vector.area_of_triangle_with怎么用?Python Vector.area_of_triangle_with使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector.Vector
的用法示例。
在下文中一共展示了Vector.area_of_triangle_with方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cross_products
# 需要导入模块: from Vector import Vector [as 别名]
# 或者: from Vector.Vector import area_of_triangle_with [as 别名]
def cross_products():
v = Vector(['8.462', '7.893', '-8.187'])
w = Vector(['6.984', '-5.975', '4.778'])
print("{0} cross {1} is {2} \n".format(v, w, v.cross_product(w)))
v = Vector(['-8.987', '-9.838', '5.031'])
w = Vector(['-4.268', '-1.861', '-8.866'])
print("area of parallelogram spanned by {0} and {1} is {2}\n".format(v, w, v.area_of_parallelogram_with(w)))
v = Vector(['1.5', '9.547', '3.691'])
w = Vector(['-6.007', '0.124', '5.772'])
print("area of triangle spanned by {0} and {1} is {2}\n".format(v, w, v.area_of_triangle_with(w)))