crossArea.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:Acoustics 作者: fei0324 项目源码 文件源码
def triangleArea(triangleSet):

    """
    Calculate areas of subdivided triangles

    Input: the set of subdivided triangles

    Output: a list of the areas with corresponding idices with the the triangleSet
    """

    triangleAreaSet = []

    for i in range(len(triangleSet)):
        v1 = triangleSet[i][1] - triangleSet[i][0]
        v2 = triangleSet[i][2] - triangleSet[i][0]
        area = np.linalg.norm(np.cross(v1, v2))/2
        triangleAreaSet.append(area)

    return triangleAreaSet
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号