quadArea

pyvsim.Utils.quadArea(p1, p2, p3, p4)[source]

Returns the area of a quadrilateral defined by its edge points. The following assumptions are made:

  • All points lie in the same plane
  • The quadrilateral is convex
Parameters :

p1, p2, p3, p4 : numpy.ndarray \((N,3)\)

Points or list of points defining quadrilaterals

Returns :

result : numpy.ndarray \((N)\)

The area of the quadrilaterals

Examples

>>> pts    = np.array([[0,0,0], 
...                    [0,1,0], 
...                    [0,1,1], 
...                    [0,0,1]])
>>> quadArea(pts[0], pts[1], pts[2], pts[3])
1.0

This Page